Created
June 6, 2013 16:01
-
-
Save elbuo8/5722666 to your computer and use it in GitHub Desktop.
Get dependencies in Jenkins
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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