1

I have two pipelines, that works isolated between each other. And a third that invoked both of them, and it require information returned by one of them.

From the Pipeline C invoke service-docker-build and I want to obtain the Docker image tag created in that pipeline.

                    def dockerBuildResponse = build job: "service-docker-build", propagate: false
                    IMAGE_TAG = dockerBuildResponse.getBuildVariables()["IMAGE_TAG"]

In the service-docker-build pipeline I define this variable

IMAGE_TAG = Globals.nexus3PrdUrl.replaceAll("^https?://", "") + "/" + Globals.image.imageName()

But I still have in pipeline C the IMAGE_TAG a null

Any idea how can I pass this value to the invoker pipeline?

Regards

Andrej Istomin
  • 2,527
  • 2
  • 15
  • 22
paul
  • 12,873
  • 23
  • 91
  • 153
  • You can try defining the IMAGE_TAG as an environment variable in Jenkins. That will be stored along with other environment variables. So when you run the `service-docker-build` pipeline the value to the environment variable will be updated and then in the pipeline `C` it will be fetched from the environment variable IMAGE_TAG. – Siddharth Kaul Nov 29 '22 at 01:08

0 Answers0