2021-08-19 16:25:58 +02:00
|
|
|
include:
|
2021-08-06 01:28:10 +02:00
|
|
|
# - local: 'ci_templates/.cic-template.yml'
|
|
|
|
# - local: 'apps/contract-migration/.gitlab-ci.yml'
|
2021-08-19 17:43:31 +02:00
|
|
|
- local: 'apps/cic-eth/.gitlab-ci.yml'
|
|
|
|
- local: 'apps/cic-ussd/.gitlab-ci.yml'
|
|
|
|
- local: 'apps/cic-notify/.gitlab-ci.yml'
|
|
|
|
- local: 'apps/cic-meta/.gitlab-ci.yml'
|
2021-08-19 16:25:58 +02:00
|
|
|
- local: 'apps/cic-cache/.gitlab-ci.yml'
|
2021-08-06 01:28:10 +02:00
|
|
|
# - local: 'apps/data-seeding/.gitlab-ci.yml'
|
|
|
|
|
2021-08-14 18:17:39 +02:00
|
|
|
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/docker-with-compose:latest
|
2021-08-06 01:28:10 +02:00
|
|
|
|
2021-01-24 21:16:22 +01:00
|
|
|
|
|
|
|
stages:
|
|
|
|
- build
|
2021-08-19 16:34:23 +02:00
|
|
|
- test
|
2021-08-06 01:28:10 +02:00
|
|
|
- deploy
|
|
|
|
|
2021-08-06 01:59:16 +02:00
|
|
|
variables:
|
2021-08-16 15:16:24 +02:00
|
|
|
DOCKER_BUILDKIT: "1"
|
|
|
|
COMPOSE_DOCKER_CLI_BUILD: "1"
|
2021-08-19 16:47:41 +02:00
|
|
|
MR_IMAGE_TAG: mr-$CI_COMMIT_SHORT_SHA
|
2021-08-19 16:25:58 +02:00
|
|
|
|
2021-08-19 16:47:41 +02:00
|
|
|
# todo you can probably just build the single image w/o docker-compose
|
2021-08-19 16:25:58 +02:00
|
|
|
build-merge-request:
|
2021-08-19 16:59:48 +02:00
|
|
|
before_script:
|
|
|
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
2021-08-19 16:31:20 +02:00
|
|
|
stage: build
|
2021-08-19 16:25:58 +02:00
|
|
|
tags:
|
|
|
|
- integration
|
|
|
|
variables:
|
|
|
|
CI_DEBUG_TRACE: "true"
|
|
|
|
script:
|
2021-08-19 16:31:20 +02:00
|
|
|
- TAG=$MR_IMAGE_TAG FRONTEND_ENV=dev sh ./scripts/build-push.sh
|
2021-08-19 16:25:58 +02:00
|
|
|
rules:
|
|
|
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
|
|
when: always
|
2021-08-06 01:59:16 +02:00
|
|
|
|
2021-08-13 21:45:27 +02:00
|
|
|
build-staging:
|
2021-08-19 16:59:48 +02:00
|
|
|
before_script:
|
|
|
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
2021-08-06 01:39:48 +02:00
|
|
|
tags:
|
2021-08-17 17:41:34 +02:00
|
|
|
- integration
|
|
|
|
#- blocal
|
2021-08-14 17:51:12 +02:00
|
|
|
variables:
|
|
|
|
CI_DEBUG_TRACE: "true"
|
2021-08-06 01:28:10 +02:00
|
|
|
stage: build
|
|
|
|
script:
|
2021-08-13 21:45:27 +02:00
|
|
|
- TAG=stag FRONTEND_ENV=staging sh ./scripts/build-push.sh
|
2021-08-06 01:28:10 +02:00
|
|
|
only:
|
2021-08-19 16:25:58 +02:00
|
|
|
- staging
|
2021-08-06 01:28:10 +02:00
|
|
|
|
2021-08-13 21:45:27 +02:00
|
|
|
deploy-staging:
|
2021-08-19 16:59:48 +02:00
|
|
|
before_script:
|
|
|
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
|
|
|
- pip install docker-auto-labels
|
2021-08-06 01:39:48 +02:00
|
|
|
tags:
|
|
|
|
- integration
|
2021-08-06 01:28:10 +02:00
|
|
|
stage: deploy
|
2021-08-13 21:45:27 +02:00
|
|
|
script:
|
|
|
|
- >
|
|
|
|
DOMAIN=stag.grassrootseconomics.net
|
|
|
|
TRAEFIK_TAG=grassrootseconomics.net
|
|
|
|
STACK_NAME=stag-cic-net
|
|
|
|
TAG=stag
|
|
|
|
sh ./scripts/deploy.sh
|
|
|
|
environment:
|
|
|
|
name: staging
|
|
|
|
url: https://stag.grassrootseconomics.net
|
2021-08-06 01:28:10 +02:00
|
|
|
only:
|
2021-08-19 16:25:58 +02:00
|
|
|
- staging
|
2021-08-13 21:45:27 +02:00
|
|
|
|
|
|
|
#build-prod:
|
|
|
|
# stage: build
|
|
|
|
# script:
|
|
|
|
# - TAG=prod FRONTEND_ENV=production sh ./scripts/build-push.sh
|
|
|
|
# only:
|
|
|
|
# - production
|
|
|
|
# tags:
|
|
|
|
# - build
|
|
|
|
# - test
|
|
|
|
#
|
|
|
|
#deploy-prod:
|
|
|
|
# stage: deploy
|
|
|
|
# script:
|
|
|
|
# - >
|
|
|
|
# DOMAIN=demo1.com
|
|
|
|
# TRAEFIK_TAG=demo1.com
|
|
|
|
# STACK_NAME=demo1-com
|
|
|
|
# TAG=prod
|
|
|
|
# sh ./scripts/deploy.sh
|
|
|
|
# environment:
|
|
|
|
# name: production
|
|
|
|
# url: https://demo1.com
|
|
|
|
# only:
|
|
|
|
# - production
|
|
|
|
# tags:
|
|
|
|
# - swarm
|
|
|
|
# - prod
|