Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 601b2c5b6c
Fetching contributors…

Cannot retrieve contributors at this time

executable file 33 lines (30 sloc) 1.307 kb
#!/usr/bin/env groovy
// Generates server-side metadata for MongoDB auto-installation
import com.gargoylesoftware.htmlunit.html.*;
import net.sf.json.*
import com.gargoylesoftware.htmlunit.WebClient
def wc = new WebClient()
def json = [];
[osx: ['i386', 'x86_64'],
linux: ['i686', 'x86_64'],
win32: ['i386', 'x86_64'],
sunos5: ['i86pc', 'x86_64']
].each { osname, archs -> archs.each { arch ->
HtmlPage p = wc.getPage("$osname/$arch")
p.selectNodes("//a[@href]").reverse().collect { HtmlAnchor e ->
def m = e.getHrefAttribute() =~ /^.*mongodb-$osname-$arch-(.*?)\.(tgz|zip)$/
if (m) {
String version = "${osname}-${arch}-${m[0][1]}"
json << [id:version, name:version, url:m[0][0]]
JSONObject envelope = JSONObject.fromObject([list:json])
println envelope.toString(2)
key = "org.jenkinsci.plugins.mongodb.MongoDBInstaller"
File d = new File("target")
new File(d,"${key}.json").write("'${key}',${envelope.toString(2)})")
Jump to Line
Something went wrong with that request. Please try again.