From 7f3bdc0bc64325d7eed9ace95f3aa98208bb27e0 Mon Sep 17 00:00:00 2001 From: curben <2809763-curben@users.noreply.gitlab.com> Date: Mon, 20 Apr 2020 11:17:53 +0100 Subject: [PATCH] ci: replace 'only/except' with 'rules' syntax - https://docs.gitlab.com/ee/ci/yaml/#rules --- .gitlab-ci.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e9a68d66..853042b9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -44,12 +44,13 @@ deploy_job: - git remote add mirror git@github.com:curbengh/urlhaus-filter.git - git push mirror master - only: - # Allow CI to be triggered by schedule - - schedules - - # Allow CI to be triggered manually - - web + rules: + # Only trigger through schedule job in master branch + - if: '$CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "schedule"' + when: always + # Only trigger through "Run pipeline" in master branch + - if: '$CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "web"' + when: always failed_job: stage: failed_stage @@ -83,6 +84,8 @@ failed_job: # Run this job only when deploy_job failed when: on_failure - only: - - schedules - - web + rules: + - if: '$CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "schedule"' + when: always + - if: '$CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "web"' + when: always