From e708b7e407722a0a21363f37200a367660d7b731 Mon Sep 17 00:00:00 2001 From: Blair Vanderlugt Date: Fri, 21 May 2021 16:08:09 +0000 Subject: [PATCH 1/7] Update ci_templates/.cic-template.yml, apps/cic-eth/.gitlab-ci.yml files --- apps/cic-eth/.gitlab-ci.yml | 20 +++++++++++++------- ci_templates/.cic-template.yml | 21 +++++++++++++++++++++ 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/apps/cic-eth/.gitlab-ci.yml b/apps/cic-eth/.gitlab-ci.yml index 607fec9c..f41073b1 100644 --- a/apps/cic-eth/.gitlab-ci.yml +++ b/apps/cic-eth/.gitlab-ci.yml @@ -13,13 +13,19 @@ build-mr-cic-eth: - .cic_eth_changes_target - .py_build_merge_request - .cic_eth_variables - variables: - PYTHONPATH: . - after_script: - - pip install -r test_requirements.txt - - pytest tests/unit/ - - pytest tests/task/ - - pytest tests/filters/ + +build-mr-unittest-cic-eth: + extends: + - .cic_eth_changes_target + - .cic_eth_variables + - .py_build_unittest_merge_request + +test-mr-unittest-cic-eth: + extends: + - .cic_eth_changes_target + - .cic_eth_variables + - .py_unittest_merge_request + build-push-cic-eth: extends: diff --git a/ci_templates/.cic-template.yml b/ci_templates/.cic-template.yml index 3fda149a..17e0267f 100644 --- a/ci_templates/.cic-template.yml +++ b/ci_templates/.cic-template.yml @@ -18,6 +18,27 @@ variables: - if: $CI_PIPELINE_SOURCE == "merge_request_event" 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 + + +.py_unittest_merge_request: + stage: test + scripts: + - docker load -i $APP-test-image.tar + - docker images + .py_build_push: stage: build variables: From 9a44107c24a37b7891a6a8d7d4b371f3ec6d42bc Mon Sep 17 00:00:00 2001 From: Blair Vanderlugt Date: Fri, 21 May 2021 16:16:57 +0000 Subject: [PATCH 2/7] Update ci_templates/.cic-template.yml --- ci_templates/.cic-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci_templates/.cic-template.yml b/ci_templates/.cic-template.yml index 17e0267f..68ce87cc 100644 --- a/ci_templates/.cic-template.yml +++ b/ci_templates/.cic-template.yml @@ -35,7 +35,7 @@ variables: .py_unittest_merge_request: stage: test - scripts: + script: - docker load -i $APP-test-image.tar - docker images From e4437ffcf3daffb3dc58a0ab51a3069619e4bebd Mon Sep 17 00:00:00 2001 From: Blair Vanderlugt Date: Fri, 21 May 2021 16:21:03 +0000 Subject: [PATCH 3/7] Update ci_templates/.cic-template.yml --- ci_templates/.cic-template.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci_templates/.cic-template.yml b/ci_templates/.cic-template.yml index 68ce87cc..9ebd3233 100644 --- a/ci_templates/.cic-template.yml +++ b/ci_templates/.cic-template.yml @@ -9,7 +9,7 @@ variables: .py_build_merge_request: stage: build variables: - - CI_DEBUG_TRACE: "true" + CI_DEBUG_TRACE: "true" script: - mkdir -p /kaniko/.docker - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > "/kaniko/.docker/config.json" @@ -21,7 +21,7 @@ variables: .py_build_unittest_merge_request: stage: build variables: - - CI_DEBUG_TRACE: "true" + CI_DEBUG_TRACE: "true" artifacts: paths: - $APP-test-image.tar From dad40c993cccdb29bd0317e5311ead8404704a41 Mon Sep 17 00:00:00 2001 From: Blair Vanderlugt Date: Fri, 21 May 2021 16:31:47 +0000 Subject: [PATCH 4/7] Update ci_templates/.cic-template.yml --- ci_templates/.cic-template.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ci_templates/.cic-template.yml b/ci_templates/.cic-template.yml index 9ebd3233..93950f22 100644 --- a/ci_templates/.cic-template.yml +++ b/ci_templates/.cic-template.yml @@ -6,17 +6,17 @@ variables: KANIKO_CACHE_ARGS: "--cache=false --cache-copy-layers=true --cache-ttl=24h" CONTEXT: $CI_PROJECT_DIR/apps/ -.py_build_merge_request: - stage: build - variables: - CI_DEBUG_TRACE: "true" - 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 --no-push - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - when: always +# .py_build_merge_request: +# stage: build +# variables: +# CI_DEBUG_TRACE: "true" +# 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 --no-push +# rules: +# - if: $CI_PIPELINE_SOURCE == "merge_request_event" +# when: always .py_build_unittest_merge_request: stage: build From 8355347323e7705fec9cd9b3ed9f2c16bdee0e88 Mon Sep 17 00:00:00 2001 From: Blair Vanderlugt Date: Fri, 21 May 2021 16:39:28 +0000 Subject: [PATCH 5/7] Update ci_templates/.cic-template.yml, apps/cic-eth/.gitlab-ci.yml files --- apps/cic-eth/.gitlab-ci.yml | 10 +++++----- ci_templates/.cic-template.yml | 22 +++++++++++----------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/apps/cic-eth/.gitlab-ci.yml b/apps/cic-eth/.gitlab-ci.yml index f41073b1..5491260b 100644 --- a/apps/cic-eth/.gitlab-ci.yml +++ b/apps/cic-eth/.gitlab-ci.yml @@ -8,11 +8,11 @@ - changes: - $CONTEXT/$APP_NAME/* -build-mr-cic-eth: - extends: - - .cic_eth_changes_target - - .py_build_merge_request - - .cic_eth_variables +# build-mr-cic-eth: +# extends: +# - .cic_eth_changes_target +# - .py_build_merge_request +# - .cic_eth_variables build-mr-unittest-cic-eth: extends: diff --git a/ci_templates/.cic-template.yml b/ci_templates/.cic-template.yml index 93950f22..9ebd3233 100644 --- a/ci_templates/.cic-template.yml +++ b/ci_templates/.cic-template.yml @@ -6,17 +6,17 @@ variables: KANIKO_CACHE_ARGS: "--cache=false --cache-copy-layers=true --cache-ttl=24h" CONTEXT: $CI_PROJECT_DIR/apps/ -# .py_build_merge_request: -# stage: build -# variables: -# CI_DEBUG_TRACE: "true" -# 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 --no-push -# rules: -# - if: $CI_PIPELINE_SOURCE == "merge_request_event" -# when: always +.py_build_merge_request: + stage: build + variables: + CI_DEBUG_TRACE: "true" + 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 --no-push + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + when: always .py_build_unittest_merge_request: stage: build From 78d632e2c7cd3faff0379635c4a56f8b1d7c1e07 Mon Sep 17 00:00:00 2001 From: Blair Vanderlugt Date: Fri, 21 May 2021 16:43:53 +0000 Subject: [PATCH 6/7] Update ci_templates/.cic-template.yml --- ci_templates/.cic-template.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ci_templates/.cic-template.yml b/ci_templates/.cic-template.yml index 9ebd3233..42d1d132 100644 --- a/ci_templates/.cic-template.yml +++ b/ci_templates/.cic-template.yml @@ -31,6 +31,9 @@ variables: - 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 + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + when: always .py_unittest_merge_request: @@ -38,6 +41,9 @@ variables: script: - docker load -i $APP-test-image.tar - docker images + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + when: always .py_build_push: stage: build From cd7c2baa90dfec547b9a6a338450f111d5fc2fb7 Mon Sep 17 00:00:00 2001 From: Blair Vanderlugt Date: Fri, 21 May 2021 16:48:05 +0000 Subject: [PATCH 7/7] Update ci_templates/.cic-template.yml --- ci_templates/.cic-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci_templates/.cic-template.yml b/ci_templates/.cic-template.yml index 42d1d132..6e0fc791 100644 --- a/ci_templates/.cic-template.yml +++ b/ci_templates/.cic-template.yml @@ -30,7 +30,7 @@ variables: 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 + - /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