Skip to content

Instantly share code, notes, and snippets.

@elbuo8
Created June 6, 2013 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elbuo8/5722666 to your computer and use it in GitHub Desktop.
Save elbuo8/5722666 to your computer and use it in GitHub Desktop.
Get dependencies in Jenkins
request = require 'request'
cheerio = require 'cheerio'
deps = ["git" ,
"github",
"ssh",
"monitoring",
"favorite",
"gravatar",
"jabber",
"sounds",
"radiatorviewplugin",
"warnings",
"analysis-core"]
for dep in deps
request.get "https://wiki.jenkins-ci.org/display/JENKINS/#{dep}+plugin", (e, r, b) ->
if not e
$ = cheerio.load b
deplist = $($('.confluenceTd')[2]).find('a')
if deplist.length > 0
for index in [0..deplist.length-1]
if deplist[index.toString()].next? and deplist[index.toString()].next.data.indexOf('optional') is -1
if deps.indexOf(deplist[index.toString()].children[0].data) is -1
deps.push(deplist[index.toString()].children[0].data)
console.log deps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment