SHARE
TWEET

Untitled

a guest Feb 28th, 2017 107 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. node {
  2.     jobDsl scriptText: 'job("example-2")'
  3.  
  4.     jobDsl scriptText: """
  5.      def project = 'Netflix/asgard'
  6.      def branchApi = new URL("https://api.github.com/repos/${project}/branches")
  7.      def branches = new groovy.json.JsonSlurper().parse(branchApi.newReader())
  8.      branches.each {
  9.        def branchName = it.name
  10.        def jobName = "${project}-${branchName}".replaceAll('/','-')
  11.        job(jobName) {
  12.          scm {
  13.            git("https://github.com/${project}.git", branchName)
  14.          }
  15.        }
  16.      }
  17.  """
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top