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.
Have you looked at the URL SCM plugin? It seems like it has the functionality you are looking for. There are also other URL-based plugins available for Jenkins that you can explore.
The simplest way is just to have a shell script build step that does a wget or curl on your URL. But the plugins that @Bernard suggests will probably give you additional functionality.
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:
- Add build step "Http Request", obviously you need to have https://wiki.jenkins-ci.org/display/JENKINS/HTTP+Request+Plugin .
- Specify your URL and HTTP method.
- Open "Advanced.." configuration. (Click it)
- Go to Response section.
- Use "Output Response to file" field to specify name and extension of your file
- Please use this screenshot for details
- after download you can find desired file inside your workspace with name that you specified in step# 5.
This plugin works great to do a get/put/post/delete on any REST type url: HTTP Request Plugin - on the Jenkins Wiki ; https://wiki.jenkins-ci.org/display/JENKINS/HTTP+Request+Plugin