Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have a Jenkins build step that downloads a URL?

Tags:

url

jenkins

I'd like to have a Jenkins build step which just downloads a given URL into the workspace. Is there a simple way to do that?

(I currently use an Ant script which does a simple <get/>. But that means I need to have that script in SVN somewhere, and check it out during the build. I find that cumbersome.)

Update: To clarify, I'd like to download a URL without installing additional software on the build system or using an additional script. (A Jenkins plugin is fine, of course.) Preferably I don't want to depend on the build slave being Linux, Windows, or whatever.

like image 301
MarnixKlooster ReinstateMonica Avatar asked Aug 19 '11 12:08

MarnixKlooster ReinstateMonica


1 Answers

How Download file with Jenkins HTTP Request Plugin. How to download file into Jenkins workspace. I was downloading a tar.gz file from our Nexus (Artifactory) which is a local repository into work-space of a Jenkins build steps. Steps to be done:

  1. Add build step "Http Request", obviously you need to have https://wiki.jenkins-ci.org/display/JENKINS/HTTP+Request+Plugin .
  2. Specify your URL and HTTP method.
  3. Open "Advanced.." configuration. (Click it)
  4. Go to Response section.
  5. Use "Output Response to file" field to specify name and extension of your file
  6. Please use this screenshot for details
  7. after download you can find desired file inside your workspace with name that you specified in step# 5.
like image 167
Sergii Zhuravskyi Avatar answered Oct 19 '22 07:10

Sergii Zhuravskyi