Skip to content

Instantly share code, notes, and snippets.

@sizovs
Last active August 29, 2015 14:04
Show Gist options
  • Save sizovs/dd8bf702fc7a62ce05e9 to your computer and use it in GitHub Desktop.
Save sizovs/dd8bf702fc7a62ce05e9 to your computer and use it in GitHub Desktop.
import groovyx.net.http.HTTPBuilder
import groovyx.net.http.HttpResponseException
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7.2')
version = args[0]
if (!version) {
throw new IllegalArgumentException("No version specified")
}
archive = "askfm-node-$version-docker.zip"
host = 'http://172.16.0.2:8081'
http = new HTTPBuilder(host)
http.auth.basic 'jenkins', 'jenkins'
path = "/nexus/content/repositories/releases/com/rubylight/askfm/askfm-node/$version/$archive"
println "Downloading file from $host$path to $archive"
new File(archive) << http.get(path:path)
ant = new AntBuilder()
ant.unzip( src:"$archive",
dest:".",
overwrite:"true" )
ant.copy(file:'askfm-node-docker/fig.yml', tofile:'fig.yml', overwrite: true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment