pass variable value from job1 to job2 tags in gitlab-ci.yml

Replace this template with your information

Describe your question in as much detail as possible:

    • Is it possible to pass variable value from job1 to job2 tags in gitlab-ci.yml.*
  • self-managed EE

    • Runner (Hint: /admin/runners):
  • *job1:
    stage:
    build
    tags:
    [BUILD-POOL]
    script:

    • echo “BUILD_MACHINE=10.15.63.4” >> build.env
      artifacts:
      reports:
      dotenv: build.env
      rules:
    • if: ‘$CI_PIPELINE_SOURCE == “web”’

job2:
stage:
test
tags:
- “$BUILD_MACHINE”
script:

  • echo “job2 test”
    needs:
    - job1
    rules:
    - if: ‘$CI_PIPELINE_SOURCE == “web”’ *
  • *I am trying this because, in job1 i am using tags:[BUILD-POOL] which will select an available free VM.

So i want to build job2 in the same VM where job1 is built.

but for me above mentioned code IP is not assigned to tags in job2.*

Thanks for taking the time to be thorough in your request, it really helps! :blush: