ci: replace 'only/except' with 'rules' syntax

- https://docs.gitlab.com/ee/ci/yaml/#rules
This commit is contained in:
curben 2020-04-20 11:17:53 +01:00
parent 4eb65ce893
commit 7f3bdc0bc6
No known key found for this signature in database
GPG Key ID: 5D9DB57A25D34EE3
1 changed files with 12 additions and 9 deletions

View File

@ -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