I’m trying to trigger a downstream pipeline for a specific commit. The commit is automaticaly created by a pipeline.
In the pipeline created by the commit the trigger is failing with the notification “downstream project could not be found” but triggering the job manually, creating the commit manually or even retrying the job is working.
Here is the used .gitlab-ci.yaml
:
image: alpine
.git-login: &git-login
- apk update && apk upgrade && apk add git
- git config --global user.name "$GITLAB_USER_NAME"
- git config --global user.email "$GITLAB_USER_EMAIL"
- git remote set-url origin "https://gitlab-ci-token:$GIT_ACCESS_TOKEN@$CI_SERVER_HOST/$CI_PROJECT_PATH.git"
- git fetch --all
ping:
stage: build
script:
- echo 'ping'
triggerTestManual:
when: manual
stage: test
trigger:
project: my-group/test-2
branch: test
strategy: depend
triggerTestAuto:
rules:
- if: $CI_COMMIT_MESSAGE =~ /^\[release\] .*/
stage: test
trigger:
project: my-group/test-2
branch: test
strategy: depend
ping:
stage: deploy
script:
- echo 'ping'
createCommit:
stage: deploy
rules:
- if: $CI_COMMIT_MESSAGE =~ /^start pipeline.*/
script:
- *git-login
# Change something
- "awk '/changeTest/{$2++}1' README.md > temp && cat temp > README.md && rm temp"
- 'git commit -am "[release] test"'
# push to different branch
- git push origin HEAD:refs/heads/test-1
Evenrything is tested on gitlab.com with shared runners.