Skip to content

Instantly share code, notes, and snippets.

@andrewfraley
Last active October 26, 2015 18:34
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 andrewfraley/ad09f5ea3456967539da to your computer and use it in GitHub Desktop.
Save andrewfraley/ad09f5ea3456967539da to your computer and use it in GitHub Desktop.
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@example.com', true, true)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment