I have a scheduled pipeline that copies some data from one server to another once a day.
The pipeline works fine on all branches but doesn't start if I select master branch (default branch) as the target branch.
I have tried on an exact copy of master and it worked fine.
I though it could be because master is protected but I tried on a protected copy of master and it worked.
I'm really not sure what's going on. When I click the "play" button next to the scheduled pipeline and it says that the job was successfully scheduled, but I cannot see any job in the job list.
Here some details on the .gitlab-ci.yml
stages:
- copy_data
- linting
- test
- deploy
lint:
needs: []
stage: linting
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH'
changes:
- "my_project/**/*.py"
script:
- ...
test:
stage: test
script:
- ...
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH'
copy_database:on-schedule:
stage: copy_data
needs: []
only:
- schedules
- $COPY_DB # this is set in the pipeline menu on gitlab
script:
- ...
timeout: 3h