2021-10-05 08:18:29 +02:00
|
|
|
stages:
|
|
|
|
- build-push
|
|
|
|
- test
|
|
|
|
|
|
|
|
variables:
|
|
|
|
APP_NAME: cic-eth
|
|
|
|
|
|
|
|
workflow:
|
|
|
|
rules:
|
|
|
|
- changes:
|
|
|
|
- apps/$APP_NAME/**/*
|
|
|
|
|
|
|
|
cic-eth:build-push:
|
|
|
|
stage: build-push
|
|
|
|
script:
|
|
|
|
- cd apps/$APP_NAME
|
|
|
|
- docker pull $REGISTRY/$APP_NAME:latest || true
|
|
|
|
- docker build --cache-from $REGISTRY/$APP_NAME:latest -t $REGISTRY/$APP_NAME:$CI_COMMIT_SHORT_SHA -f docker/Dockerfile .
|
|
|
|
- docker push $REGISTRY/$APP_NAME --all-tags
|
|
|
|
rules:
|
|
|
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_REF_PROTECTED == "true"
|
|
|
|
|
|
|
|
cic-eth:test:
|
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
2021-08-28 18:26:16 +02:00
|
|
|
stage: test
|
2021-10-05 08:18:29 +02:00
|
|
|
needs: ["cic-eth:build-push"]
|
2021-08-28 18:26:16 +02:00
|
|
|
variables:
|
2021-10-05 08:18:29 +02:00
|
|
|
allow_failure: true
|
2021-08-28 18:26:16 +02:00
|
|
|
script:
|
2021-10-05 08:18:29 +02:00
|
|
|
- docker run $REGISTRY/$APP_NAME:$CI_COMMIT_SHORT_SHA sh docker/run_tests.sh
|
2021-09-07 20:56:17 +02:00
|
|
|
rules:
|
|
|
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|