diff --git a/capif/templates/cd-deploy-ocf.gitlab-ci.yml b/capif/templates/cd-deploy-ocf.gitlab-ci.yml index 52f56bfe16e731a2cbd915fbcc4fbdb1011b05d3..34869563b75f3c107fe57a9a033028cf1a99a0d1 100644 --- a/capif/templates/cd-deploy-ocf.gitlab-ci.yml +++ b/capif/templates/cd-deploy-ocf.gitlab-ci.yml @@ -28,13 +28,6 @@ variables: tags: - shell -.staging_post_mr: &staging_post_mr - tags: - - shell - rules: - - if: '$CI_COMMIT_REF_NAME == "staging"' - when: always - .dev_common: &dev_common tags: - shell @@ -118,9 +111,11 @@ delete_ocf_staging: ### staging branch merged ### deploy_ocf_oficial_staging: stage: deploy_ocf_oficial_staging + rules: + - if: '$CI_COMMIT_REF_NAME == "staging"' + when: always needs: - staging_build_and_push_mr - <<: *staging_post_mr environment: name: review/oficial-staging url: https://capif-staging.$DOMAIN_STAGING diff --git a/capif/templates/ci_staging.gitlab-ci.yml b/capif/templates/ci_staging.gitlab-ci.yml index e59f13ff52ecc344d07f0eb5b586f30867f5b1bb..c15dd55c0ca40034ef870b1666642a6660f41a34 100644 --- a/capif/templates/ci_staging.gitlab-ci.yml +++ b/capif/templates/ci_staging.gitlab-ci.yml @@ -17,20 +17,14 @@ variables: CAPIF_DOCKER_REGISTRY: $CAPIF_DOCKER_REGISTRY .staging_common: &staging_common - rules: - - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "staging"' - when: always + only: + - merge_requests + except: + variables: + - $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != "staging" tags: - shell -.staging_mr: &staging_mr - rules: - - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == "staging"' - when: always - tags: - - shell - - .staging_dnd: &staging_dnd allow_failure: true rules: @@ -329,6 +323,9 @@ staging_build_and_push: ### staging branch merged ### staging_build_and_push_mr: stage: staging_build_and_push_mr + rules: + - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == "staging"' + when: always script: - export TMP_PWD=$PWD - echo "TMP_PWD=$TMP_PWD" @@ -405,5 +402,4 @@ staging_build_and_push_mr: - docker build -t $CI_REGISTRY/ocf/capif/staging/helper:staging . - docker push $CI_REGISTRY/ocf/capif/staging/helper:staging - echo "----------------------------------------------------" - - docker logout $CI_REGISTRY - <<: *staging_mr \ No newline at end of file + - docker logout $CI_REGISTRY \ No newline at end of file