Merge branch 'cic-eth-unittest' of gitlab.com:grassrootseconomics/cic-internal-integration into cic-eth-unittest

This commit is contained in:
nolash 2021-05-21 18:55:04 +02:00
commit c10783aebf
2 changed files with 43 additions and 10 deletions

View File

@ -8,18 +8,24 @@
- changes: - changes:
- $CONTEXT/$APP_NAME/* - $CONTEXT/$APP_NAME/*
build-mr-cic-eth: # build-mr-cic-eth:
# extends:
# - .cic_eth_changes_target
# - .py_build_merge_request
# - .cic_eth_variables
build-mr-unittest-cic-eth:
extends: extends:
- .cic_eth_changes_target - .cic_eth_changes_target
- .py_build_merge_request
- .cic_eth_variables - .cic_eth_variables
variables: - .py_build_unittest_merge_request
PYTHONPATH: .
after_script: test-mr-unittest-cic-eth:
- pip install -r test_requirements.txt extends:
- pytest tests/unit/ - .cic_eth_changes_target
- pytest tests/task/ - .cic_eth_variables
- pytest tests/filters/ - .py_unittest_merge_request
build-push-cic-eth: build-push-cic-eth:
extends: extends:

View File

@ -9,7 +9,7 @@ variables:
.py_build_merge_request: .py_build_merge_request:
stage: build stage: build
variables: variables:
- CI_DEBUG_TRACE: "true" CI_DEBUG_TRACE: "true"
script: script:
- mkdir -p /kaniko/.docker - mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > "/kaniko/.docker/config.json" - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > "/kaniko/.docker/config.json"
@ -18,6 +18,33 @@ variables:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: always when: always
.py_build_unittest_merge_request:
stage: build
variables:
CI_DEBUG_TRACE: "true"
artifacts:
paths:
- $APP-test-image.tar
expire_in: 1 week
when: on_success
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 --cache-repo $CI_REGISTRY_IMAGE --target test --tarPath $APP-test-image.tar --no-push
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: always
.py_unittest_merge_request:
stage: test
script:
- docker load -i $APP-test-image.tar
- docker images
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: always
.py_build_push: .py_build_push:
stage: build stage: build
variables: variables: