cic-internal-integration/apps/cic-meta/.gitlab-ci.yml

45 lines
1.3 KiB
YAML
Raw Permalink Normal View History

2021-02-08 18:31:29 +01:00
.cic_meta_variables:
variables:
APP_NAME: cic-meta
DOCKERFILE_PATH: $APP_NAME/docker/Dockerfile
2021-06-07 18:11:03 +02:00
IMAGE_TAG: $CI_REGISTRY_IMAGE/$APP_NAME:unittest-$CI_COMMIT_SHORT_SHA
2021-02-08 18:31:29 +01:00
.cic_meta_changes_target:
2021-02-08 18:31:29 +01:00
rules:
2021-06-07 18:11:03 +02:00
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
# - changes:
# - $CONTEXT/$APP_NAME/*
- when: always
2021-02-08 18:31:29 +01:00
2021-06-07 18:11:03 +02:00
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:
2021-02-08 18:31:29 +01:00
extends:
- .cic_meta_variables
2021-06-07 18:11:03 +02:00
- .cic_meta_changes_target
stage: test
image: $IMAGE_TAG
script:
- cd /tmp/src/cic-meta
- npm install --dev
- npm run test
- npm run test:coverage
needs: ["cic-meta-build-mr"]
2021-02-08 18:31:29 +01:00
build-push-cic-meta:
extends:
- .py_build_push
- .cic_meta_variables