Cher
Cher

Reputation: 2937

in jenkins, how to copy artifacts from another server?

I have another project from which I need to copy artifacts.

However the problem I have is that it's from another server. Is there a way to do so with the copy artifact or I'll have to go through code?

Upvotes: 2

Views: 16492

Answers (4)

Bhupender Kumawat
Bhupender Kumawat

Reputation: 41

Publish over ssh plugin can also be used for copying the files/artifacts from one server (local/linux) to another server. It has retries option also in case there is network issue and no. of retires and timeout also can be configured.

Upvotes: 0

Vitalii Elenhaupt
Vitalii Elenhaupt

Reputation: 7326

For a long time I use this python script to download artifacts from Jenkins. It takes advantage of the JSON API layer available to any Jenkins job. The format of that API call is:

http://_YOUR_BUILD_HOST_/job/_JOBNAME_/lastSuccessfulBuild/api/json

Beware script depends on PyCurl.

Upvotes: 0

Cher
Cher

Reputation: 2937

I used a wget to fetch the file in the end, with fixed paths.

This link can help for someone not used with wget.

Using wget to recursively fetch a directory with arbitrary files in it

Upvotes: 3

Nirmal
Nirmal

Reputation: 1259

You can accomplish by either publishing your artifact and using either file transfer or secure shell.

Here is info to read upon:

Jenkins Secure Shell Plugin

Jenkins FTP Plugin

The only other possibility is to modify the ant or maven project config file.

Here is a More Reference along the same lines.

Upvotes: 3

Related Questions