I have a yml that creates and triggers a child yml with several jobs, however, only the fist job actually gets executed and I have no clue why. Below is a minmal example that results in job-0 being executed and job-1 and job-2 ignored
.gitlab-ci.yml
stages:
- child-pipeline-generator
- child-pipeline-trigger
generate-child-pipeline:
stage: child-pipeline-generator
tags:
- yourRunner
script:
- $(./generate-child-pipeline.ps1) *>&1 > child-pipeline-gitlab-ci.yml
- (Get-Content child-pipeline-gitlab-ci.yml) | Set-Content child-pipeline-gitlab-ci.yml -Encoding UTF8
- Get-Content child-pipeline-gitlab-ci.yml
artifacts:
paths:
- child-pipeline-gitlab-ci.ymltrigger-child-pipeline:
stage: child-pipeline-trigger
trigger:
include:
- artifact: child-pipeline-gitlab-ci.yml
job: generate-child-pipeline
generate-child-pipeline.ps1
for ($i=0; $i -lt 3; $i++){
echo "job-$($i):
tags:
- yourRunner
script:
- echo $i
";
}
child-pipeline-gitlab-ci.yml
job-0:
tags:
- yourRunner
script:
- echo 0job-1:
tags:
- yourRunner
script:
- echo 1job-2:
tags:
- yourRunner
script:
- echo 2