Gitlab – passing job id of parent pipeline to child pipeline

Yes, it’s supported by Gitlab. You need to pass the CI_PIPELINE_ID built-in variable.


.trigger_deploy:
  stage: deploy
  strategy: depend
  trigger:
    include:
       - project: '<namespace>/<project>'
         ref: '<branch>'
         file: '<path to yml file>'
  variables:
      PARENT_PIPELINE_ID: $CI_PIPELINE_ID
      PARENT_JOB_ID: $CI_JOB_ID

You can file these and more variables in Gitlab predefined variables documentation

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top