cic-ussd build

This commit is contained in:
Blair Vanderlugt 2021-02-06 18:28:08 +00:00
parent 047091367c
commit be15ac6899
2 changed files with 20 additions and 38 deletions

View File

@ -2,6 +2,7 @@ include:
- local: 'ci_templates/.cic-template.yml' - local: 'ci_templates/.cic-template.yml'
- local: 'apps/contract-migration/.gitlab-ci.yml' - local: 'apps/contract-migration/.gitlab-ci.yml'
- local: 'apps/cic-eth/.gitlab-ci.yml' - local: 'apps/cic-eth/.gitlab-ci.yml'
- local: 'apps/cic-ussd/.gitlab-ci.yml'
stages: stages:
- build - build

View File

@ -1,42 +1,23 @@
image: docker:19.03.13 .cic_ussd_variables:
variables:
APP_NAME: cic-ussd
DOCKERFILE_PATH: $APP_NAME/docker/Dockerfile
variables: .this_changes_target:
# docker host rules:
DOCKER_HOST: tcp://docker:2376 - changes:
# container, thanks to volume mount from config.toml - $CONTEXT/$APP_NAME/*
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"
services: build-mr-cic-ussd:
- docker:19.03.13-dind extends:
- .this_changes_target
- .py_build_merge_request
- .cic_ussd_variables
before_script: build-push-cic-ussd:
- docker info extends:
- .this_changes_target
build_merge_request: - .py_build_push
stage: build - .cic_ussd_variables
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