Last active
October 26, 2015 18:34
-
-
Save andrewfraley/ad09f5ea3456967539da to your computer and use it in GitHub Desktop.
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
def organization = 'IT-Puppet' | |
def github_url = 'https://your-github-enterprise.local' | |
def page = 1 | |
def linkHeader = 'rel="next"' | |
def pages = [] | |
while (linkHeader =~ /.*rel="next"/ ) { | |
repoApi = new URL("${github_url}/api/v3/orgs/${organization}/repos?page=${page}") | |
linkHeader = repoApi.openConnection().getHeaderField("Link") | |
println linkHeader | |
pages << new groovy.json.JsonSlurper().parse(repoApi.newReader()) | |
page++ | |
} | |
pages.each { | |
it.each { | |
def repoName = it.name | |
job ("${organization}-${repoName}".replaceAll('/','-')){ | |
scm { | |
git("${github_url}/${organization}/${repoName}") | |
} | |
steps { | |
shell("/usr/local/bin/check_puppet_style.sh -x autoloader_layout -f ./") | |
} | |
triggers { | |
scm('H/30 * * * *') | |
} | |
publishers { | |
warnings(['Puppet-lint']) | |
mailer('[email protected]', true, true) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment