Update .gitlab-ci.yml, apps/data-seeding/.gitlab-ci.yml, apps/cic-ussd/.gitlab-ci.yml, apps/cic-notify/.gitlab-ci.yml, apps/cic-meta/.gitlab-ci.yml, apps/cic-cache/.gitlab-ci.yml files

This commit is contained in:
Blair Vanderlugt 2021-07-06 20:05:18 +00:00
parent 58f3a90206
commit d679a8441e
6 changed files with 60 additions and 42 deletions

View File

@ -6,7 +6,7 @@ include:
# - local: 'apps/cic-notify/.gitlab-ci.yml' # - local: 'apps/cic-notify/.gitlab-ci.yml'
# - local: 'apps/cic-meta/.gitlab-ci.yml' # - local: 'apps/cic-meta/.gitlab-ci.yml'
# - local: 'apps/cic-cache/.gitlab-ci.yml' # - local: 'apps/cic-cache/.gitlab-ci.yml'
# - local: 'apps/data-seeding/.gitlab-ci.yml' - local: 'apps/data-seeding/.gitlab-ci.yml'
stages: stages:
- build - build

View File

@ -3,20 +3,24 @@
APP_NAME: cic-cache APP_NAME: cic-cache
DOCKERFILE_PATH: $APP_NAME/docker/Dockerfile DOCKERFILE_PATH: $APP_NAME/docker/Dockerfile
.cic_cache_changes_target:
rules:
- changes:
- $CONTEXT/$APP_NAME/*
build-mr-cic-cache: build-mr-cic-cache:
extends: extends:
- .cic_cache_changes_target
- .py_build_merge_request - .py_build_merge_request
- .cic_cache_variables - .cic_cache_variables
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- apps/cic-cache/**/*
when: always
build-push-cic-cache: build-push-cic-cache:
extends: extends:
- .py_build_push - .py_build_push
- .cic_cache_variables - .cic_cache_variables
rules:
- if: $CI_COMMIT_BRANCH == "master"
changes:
- apps/cic-cache/**/*
when: always

View File

@ -5,40 +5,40 @@
DOCKERFILE_PATH: $APP_NAME/docker/Dockerfile DOCKERFILE_PATH: $APP_NAME/docker/Dockerfile
IMAGE_TAG: $CI_REGISTRY_IMAGE/$APP_NAME:unittest-$CI_COMMIT_SHORT_SHA IMAGE_TAG: $CI_REGISTRY_IMAGE/$APP_NAME:unittest-$CI_COMMIT_SHORT_SHA
.cic_meta_changes_target: build-mr-cic-meta:
extends:
- .py_build_merge_request
- .cic_notify_variables
rules: rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_PIPELINE_SOURCE == "merge_request_event"
# - changes: changes:
# - $CONTEXT/$APP_NAME/* - apps/cic-meta/**/*
- when: always when: always
cic-meta-build-mr:
stage: build
extends:
- .cic_meta_variables
- .cic_meta_changes_target
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > "/kaniko/.docker/config.json"
# - /kaniko/executor --context $CONTEXT --dockerfile $DOCKERFILE_PATH $KANIKO_CACHE_ARGS --destination $IMAGE_TAG
- /kaniko/executor --context $CONTEXT --dockerfile $DOCKERFILE_PATH $KANIKO_CACHE_ARGS --destination $IMAGE_TAG
test-mr-cic-meta: test-mr-cic-meta:
extends: extends:
- .cic_meta_variables - .cic_meta_variables
- .cic_meta_changes_target - .cic_meta_changes_target
stage: test stage: test
image: $IMAGE_TAG image: $MR_IMAGE_TAG
script: script:
- cd /tmp/src/cic-meta - cd /tmp/src/cic-meta
- npm install --dev - npm install --dev
- npm run test - npm run test
- npm run test:coverage - npm run test:coverage
needs: ["cic-meta-build-mr"] needs: ["cic-meta-build-mr"]
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- apps/cic-meta/**/*
when: always
build-push-cic-meta: build-push-cic-meta:
extends: extends:
- .py_build_push - .py_build_push
- .cic_meta_variables - .cic_meta_variables
rules:
- if: $CI_COMMIT_BRANCH == "master"
changes:
- apps/cic-meta/**/*
when: always

View File

@ -3,20 +3,25 @@
APP_NAME: cic-notify APP_NAME: cic-notify
DOCKERFILE_PATH: $APP_NAME/docker/Dockerfile DOCKERFILE_PATH: $APP_NAME/docker/Dockerfile
.cic_notify_changes_target:
rules:
- changes:
- $CONTEXT/$APP_NAME/*
build-mr-cic-notify: build-mr-cic-notify:
extends: extends:
- .cic_notify_changes_target - .cic_notify_changes_target
- .py_build_merge_request - .py_build_merge_request
- .cic_notify_variables - .cic_notify_variables
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- apps/cic-notify/**/*
when: always
build-push-cic-notify: build-push-cic-notify:
extends: extends:
- .py_build_push - .py_build_push
- .cic_notify_variables - .cic_notify_variables
rules:
- if: $CI_COMMIT_BRANCH == "master"
changes:
- apps/cic-notify/**/*
when: always

View File

@ -3,20 +3,25 @@
APP_NAME: cic-ussd APP_NAME: cic-ussd
DOCKERFILE_PATH: $APP_NAME/docker/Dockerfile DOCKERFILE_PATH: $APP_NAME/docker/Dockerfile
.cic_ussd_changes_target:
rules:
- changes:
- $CONTEXT/$APP_NAME/*
build-mr-cic-ussd: build-mr-cic-ussd:
extends: extends:
- .cic_ussd_changes_target - .cic_ussd_changes_target
- .py_build_merge_request - .py_build_merge_request
- .cic_ussd_variables - .cic_ussd_variables
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- apps/cic-ussd/**/*
when: always
build-push-cic-ussd: build-push-cic-ussd:
extends: extends:
- .py_build_push - .py_build_push
- .cic_ussd_variables - .cic_ussd_variables
rules:
- if: $CI_COMMIT_BRANCH == "master"
changes:
- apps/cic-ussd/**/*
when: always

View File

@ -3,19 +3,23 @@
APP_NAME: data-seeding APP_NAME: data-seeding
DOCKERFILE_PATH: $APP_NAME/docker/Dockerfile_ci DOCKERFILE_PATH: $APP_NAME/docker/Dockerfile_ci
.data_seeding_changes_target:
rules:
- changes:
- $CONTEXT/$APP_NAME/*
build-mr-data-seeding: build-mr-data-seeding:
extends: extends:
- .data_seeding_changes_target
- .py_build_merge_request - .py_build_merge_request
- .data_seeding_variables - .data_seeding_variables
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- apps/data-seeding/**/*
when: always
build-push-data-seeding: build-push-data-seeding:
extends: extends:
- .py_build_push - .py_build_push
- .data_seeding_variables - .data_seeding_variables
rules:
- if: $CI_COMMIT_BRANCH == "master"
changes:
- apps/data-seeding/**/*
when: always