From 8cdd40512259eeeecd6725f8a3cebc3b33552b54 Mon Sep 17 00:00:00 2001 From: Blair Vanderlugt Date: Tue, 6 Jul 2021 19:51:53 +0000 Subject: [PATCH] Update apps/contract-migration/docker/Dockerfile, apps/cic-eth/.gitlab-ci.yml, ci_templates/.cic-template.yml, apps/contract-migration/.gitlab-ci.yml files --- apps/cic-eth/.gitlab-ci.yml | 23 +++++++++++++--------- apps/contract-migration/.gitlab-ci.yml | 24 +++++++++++------------ apps/contract-migration/docker/Dockerfile | 4 +--- ci_templates/.cic-template.yml | 3 --- 4 files changed, 26 insertions(+), 28 deletions(-) diff --git a/apps/cic-eth/.gitlab-ci.yml b/apps/cic-eth/.gitlab-ci.yml index 7600d75b..58c0d13b 100644 --- a/apps/cic-eth/.gitlab-ci.yml +++ b/apps/cic-eth/.gitlab-ci.yml @@ -4,25 +4,20 @@ DOCKERFILE_PATH: docker/Dockerfile_ci CONTEXT: $CI_PROJECT_DIR/apps/$APP_NAME -.cic_eth_changes_target: +build-mr-cic-eth: + extends: + - .cic_eth_variables + - .py_build_target_dev rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" changes: - $CONTEXT/**/* when: always - - when: never - -build-mr-cic-eth: - extends: - - .cic_eth_variables - - .cic_eth_changes_target - - .py_build_target_dev test-mr-cic-eth: stage: test extends: - .cic_eth_variables - - .cic_eth_changes_target cache: key: files: @@ -35,8 +30,18 @@ test-mr-cic-eth: - pip install -r test_requirements.txt - export PYTHONPATH=. && pytest -x --cov=cic_eth --cov-fail-under=90 --cov-report term-missing tests needs: ["build-mr-cic-eth"] + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + changes: + - $CONTEXT/**/* + when: always build-push-cic-eth: extends: - .py_build_push - .cic_eth_variables + rules: + - if: $CI_COMMIT_BRANCH == "master" + changes: + - $CONTEXT/**/* + when: always diff --git a/apps/contract-migration/.gitlab-ci.yml b/apps/contract-migration/.gitlab-ci.yml index 3f0003bd..035e2746 100644 --- a/apps/contract-migration/.gitlab-ci.yml +++ b/apps/contract-migration/.gitlab-ci.yml @@ -2,26 +2,24 @@ variables: APP_NAME: contract-migration DOCKERFILE_PATH: $APP_NAME/docker/Dockerfile_ci - -# .contract_migration_changes_target: -# rules: -# - changes: -# - $CONTEXT/$APP_NAME/* - -.contract_migration_changes_target: - rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - changes: - - apps/contract-migration/**/* - when: always + CONTEXT: $CI_PROJECT_DIR/apps/$APP_NAME build-mr-contract-migration: extends: - - .contract_migration_changes_target - .py_build_merge_request - .contract_migration_variables + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + changes: + - $CONTEXT/**/* + when: always build-push-contract-migration: extends: - .py_build_push - .contract_migration_variables + rules: + - if: $CI_COMMIT_BRANCH == "master" + changes: + - $CONTEXT/**/* + when: always diff --git a/apps/contract-migration/docker/Dockerfile b/apps/contract-migration/docker/Dockerfile index b586a0f8..163e6545 100644 --- a/apps/contract-migration/docker/Dockerfile +++ b/apps/contract-migration/docker/Dockerfile @@ -39,6 +39,4 @@ RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \ -r requirements.txt COPY contract-migration/ . -RUN chmod +x *.sh - -RUN echo "TEST THE RULESSSS" +RUN chmod +x *.sh \ No newline at end of file diff --git a/ci_templates/.cic-template.yml b/ci_templates/.cic-template.yml index 81799d34..6125c0ed 100644 --- a/ci_templates/.cic-template.yml +++ b/ci_templates/.cic-template.yml @@ -37,9 +37,6 @@ variables: - 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 --destination $CI_REGISTRY_IMAGE/$APP_NAME:latest - rules: - - if: $CI_COMMIT_BRANCH == "master" - when: always