I work on a GitLab pipeline and from the gitlab-ci.yml
file, I include 3 times the same child file but with different inputs.
In the child file, there is a stage (display) called everytime and it currently displays values for inputs.
When the pipeline executes, I see only logs from the third include and not for the 2 firsts.
I mean that I see $branch is equals to “master” but not to “develop” or “release/1.37”.
How is it possible?
Below is my gitlab-ci.yml
file:
spec:
inputs:
RunAllApexTests:
description: "Run all apex tests"
type: boolean
default: false
---
include:
- local: "ci/deploy.gitlab-ci.yml"
inputs:
branch: develop
run_all_apex_tests: $[[ inputs.RunAllTests ]]
- local: "ci/deploy.gitlab-ci.yml"
inputs:
branch: release/1.37
- local: "ci/deploy.gitlab-ci.yml"
inputs:
branch: master
And now is my child file (ci/deploy.gitlab-ci.yml
):
spec:
inputs:
branch:
description: "The corresponding branch to consider"
type: string
regex: ^(master|develop|release\/.*)$
run_all_apex_tests:
description: "Run all apex tests"
type: string
default: "false"
---
stages:
- display
.base-deploy:
variables:
branch: $[[ inputs.branch ]]
runAllApexTests: $[[ inputs.run_all_apex_tests ]]
display:
stage: display
extends: .base-deploy
script:
- echo "Stage display";
- echo $runAllApexTests;
- echo $branch;
And below are the logs:
$ echo "Stage display";
Stage display
$ echo $runAllApexTests;
false
$ echo $branch;
master
Does it mean the 2 first include are not executed?