saugata
saugata

Reputation: 2863

GoCD - How to copy files across machines/pipelines

I have two pipelines running on different agents, one to make a build and run unit tests another to deploy the artifacts to tomcat. The first pipeline is configured to store the artifacts, the files are copied to server/artifacts/pipelines/xx folder. How to get the second pipeline to copy the file on the second agent?

Upvotes: 1

Views: 4793

Answers (2)

Nenad Bozic
Nenad Bozic

Reputation: 3784

As Juhi said in previous answer you can make build pipeline upstream dependency for deploy pipeline. When you create deploy pipeline be sure to select in Step 2: Materials Pipeline as material and select build pipeline.

Since Go CD has client server architecture, all artifacts defined in one pipeline are transferred to server and available to all downstream dependencies. This happens since you can have multiple agents and there is no guarantee same agent will do both build and deploy.

In downstream pipeline (deploy pipeline in your case) you can add job with Fetch Task where you can select build pipeline, stage and job which created artifact and give it path to your artifact.

You can even create template out of deploy and use it for deploy on different environments.

Upvotes: 3

Juhi Jariwala
Juhi Jariwala

Reputation: 41

You can create pipeline dependency between the first and second pipeline. Refer create pipeline dependncy document. After that setup fetch artifact task in the second pipeline to fetch artifacts from the first pipeline.

Upvotes: 1

Related Questions