Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gitlab not expanding variable used in parallel/matrix

I am trying to pass the variable to parallel/matrix and do not see that getting expanded and the job failing. This is being set in the job from the environment variable. I am trying to echo the variable in script and see it shows the right value, but does not get substituted in parallel/matrix. Am I missing anything?

.common_deploy:
  script:
    - |
      echo "showing the regions from environment"
      echo $qa_regions
      echo "showing the regions from job variable"
      echo $REGIONS
  parallel:
    matrix:
      - REGION: "${REGIONS}"
      
DeployToQA:
  variables:
    ENVIRONMENT: qa
    REGIONS: $qa_regions
  extends:
    - .common_deploy
  stage: deploy
  rules:
    - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "master"'
      allow_failure: true

Here the variable $qa_regions has the value of "us-west-2,us-east-1", I was expecting to see the 2 jobs for those regions , but i am seeing the job as DeployToQA: [${REGIONS}]

like image 951
Srinivas Boga Avatar asked Jul 15 '26 23:07

Srinivas Boga


1 Answers

Variable expansion for the parallel keyword is currently not supported. There is an open issue for this request.

You can take a look at the documentation where variables can be used.

like image 135
danielnelz Avatar answered Jul 17 '26 17:07

danielnelz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!