From be15ac68993c4d0a4d3e57ff811a3281bb11a456 Mon Sep 17 00:00:00 2001 From: Blair Vanderlugt Date: Sat, 6 Feb 2021 18:28:08 +0000 Subject: [PATCH] cic-ussd build --- .gitlab-ci.yml | 1 + apps/cic-ussd/.gitlab-ci.yml | 57 ++++++++++++------------------------ 2 files changed, 20 insertions(+), 38 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c81e998b..d3053e25 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,7 @@ include: - local: 'ci_templates/.cic-template.yml' - local: 'apps/contract-migration/.gitlab-ci.yml' - local: 'apps/cic-eth/.gitlab-ci.yml' + - local: 'apps/cic-ussd/.gitlab-ci.yml' stages: - build diff --git a/apps/cic-ussd/.gitlab-ci.yml b/apps/cic-ussd/.gitlab-ci.yml index 1eb3aa53..2e06e7cf 100644 --- a/apps/cic-ussd/.gitlab-ci.yml +++ b/apps/cic-ussd/.gitlab-ci.yml @@ -1,42 +1,23 @@ -image: docker:19.03.13 +.cic_ussd_variables: + variables: + APP_NAME: cic-ussd + DOCKERFILE_PATH: $APP_NAME/docker/Dockerfile -variables: - # docker host - DOCKER_HOST: tcp://docker:2376 - # container, thanks to volume mount from config.toml - DOCKER_TLS_CERTDIR: "/certs" - # These are usually specified by the entrypoint, however the - # Kubernetes executor doesn't run entrypoints - # https://gitlab.com/gitlab-org/gitlab-runner/-/issues/4125 - DOCKER_TLS_VERIFY: 1 - DOCKER_CERT_PATH: "$DOCKER_TLS_CERTDIR/client" +.this_changes_target: + rules: + - changes: + - $CONTEXT/$APP_NAME/* -services: - - docker:19.03.13-dind +build-mr-cic-ussd: + extends: + - .this_changes_target + - .py_build_merge_request + - .cic_ussd_variables -before_script: - - docker info - -build_merge_request: - stage: build - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - when: always - script: - - docker build -t $CI_PROJECT_PATH_SLUG:$CI_COMMIT_SHORT_SHA -f docker/Dockerfile . - -build_image: - stage: build - variables: - IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA - LATEST_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-latest - script: - # - docker build -t $IMAGE_TAG . - - echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" $CI_REGISTRY --password-stdin - - docker build -t $IMAGE_TAG -f docker/Dockerfile . - - docker push $IMAGE_TAG - - docker tag $IMAGE_TAG $LATEST_TAG - - docker push $LATEST_TAG - only: - - master +build-push-cic-ussd: + extends: + - .this_changes_target + - .py_build_push + - .cic_ussd_variables +