I am trying to trigger a pipeline from another pipeline using '$CI_JOB_TOKEN' (https://docs.gitlab.com/ee/ci/triggers/README.html#when-used-with-multi-project-pipelines). The second pipeline is getting triggered, but it is always executing the build stage of the second pipeline. Which means it is only executing those jobs with 'except: - triggers'. I wanted to execute jobs with 'only: -triggers'
trigger-child-pipeline:
stage: trigger-child-pipeline
only:
- triggers
tags:
- runner
script:
- curl --request POST --form "token=$CI_JOB_TOKEN" --form ref=my_branch https://gitlab.mycompany.com/api/v4/projects/1234/trigger/pipeline
I wanted to execute jobs with 'only trigger' tag in the child pipeline. Am I missing anything? I couldnt figure out anything from the documentation(https://docs.gitlab.com/ee/ci/triggers/README.html#when-used-with-multi-project-pipelines).
Thanks