cic-internal-integration/.gitlab-ci.yml

80 lines
2.1 KiB
YAML
Raw Permalink Normal View History

2021-01-24 21:16:22 +01:00
include:
2021-08-28 18:26:16 +02:00
#- local: 'ci_templates/.cic-template.yml' #kaniko build templates
# these includes are app specific unit tests
- local: 'apps/cic-eth/.gitlab-ci.yml'
2021-02-06 19:28:08 +01:00
- local: 'apps/cic-ussd/.gitlab-ci.yml'
2021-02-07 03:29:24 +01:00
- local: 'apps/cic-notify/.gitlab-ci.yml'
2021-02-08 18:31:29 +01:00
- local: 'apps/cic-meta/.gitlab-ci.yml'
2021-02-18 06:04:30 +01:00
- local: 'apps/cic-cache/.gitlab-ci.yml'
2021-08-28 18:26:16 +02:00
#- local: 'apps/contract-migration/.gitlab-ci.yml'
#- local: 'apps/data-seeding/.gitlab-ci.yml'
2021-01-24 21:16:22 +01:00
stages:
2021-10-16 00:01:42 +02:00
- version
2021-01-24 21:16:22 +01:00
- build
- test
2021-09-21 08:04:44 +02:00
- deploy
2021-08-28 18:26:16 +02:00
2021-09-21 08:04:44 +02:00
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/docker-with-compose:latest
2021-08-28 18:26:16 +02:00
variables:
DOCKER_BUILDKIT: "1"
2021-09-21 08:04:44 +02:00
COMPOSE_DOCKER_CLI_BUILD: "1"
2021-08-28 18:26:16 +02:00
CI_DEBUG_TRACE: "true"
SEMVERBOT_VERSION: "0.2.0"
2021-08-28 18:26:16 +02:00
#before_script:
# - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
2021-08-28 18:26:16 +02:00
2021-10-15 23:58:58 +02:00
version:
2021-10-19 02:52:24 +02:00
#image: python:3.7-stretch
2021-10-19 21:12:32 +02:00
image: registry.gitlab.com/grassrootseconomics/cic-base-images/ci-version:b01318ae
2021-10-15 23:58:58 +02:00
stage: version
script:
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
- ssh-keyscan gitlab.com >> ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
2021-10-17 03:00:07 +02:00
- git remote set-url origin git@gitlab.com:grassrootseconomics/cic-internal-integration.git
2021-10-19 22:35:49 +02:00
- export TAG=$(sbot predict version -m auto)
2021-10-18 19:08:44 +02:00
- |
if [[ -z $TAG ]]
then
echo "tag could not be set $@"
exit 1
fi
- echo $TAG > version
2021-10-15 23:58:58 +02:00
- git tag -a v$TAG -m "ci tagged"
- git push origin v$TAG
artifacts:
paths:
- version
2021-10-16 03:47:01 +02:00
rules:
- if: $CI_COMMIT_REF_PROTECTED == "true"
when: always
2021-10-19 02:52:24 +02:00
- if: $CI_COMMIT_REF_NAME == "master"
when: always
2021-10-15 23:58:58 +02:00
2021-08-28 18:26:16 +02:00
# runs on protected branches and pushes to repo
build-push:
stage: build
tags:
- integration
2021-09-01 22:00:44 +02:00
#script:
2021-10-18 19:13:48 +02:00
# - TAG=$CI_Cbefore_script:
2021-10-18 20:06:47 +02:00
before_script:
2021-10-18 20:02:08 +02:00
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
2021-08-28 18:26:16 +02:00
script:
2021-10-19 21:12:32 +02:00
- TAG=latest ./scripts/build-push.sh
2021-10-15 23:58:58 +02:00
- TAG=$(cat ./version) ./scripts/build-push.sh
2021-08-28 18:26:16 +02:00
rules:
- if: $CI_COMMIT_REF_PROTECTED == "true"
when: always
2021-10-19 02:52:24 +02:00
- if: $CI_COMMIT_REF_NAME == "master"
when: always
deploy-dev:
stage: deploy
trigger: grassrootseconomics/devops
when: manual