Skip to content

Instantly share code, notes, and snippets.

@chetan
Last active December 28, 2015 14:39
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 chetan/7515779 to your computer and use it in GitHub Desktop.
Save chetan/7515779 to your computer and use it in GitHub Desktop.
def apps = [ "app1":
[ "repos": ["foo", "bar"],
"name": "app1",
"version": 1
],
"app2":
[ "repos": ["foo"],
"name": "app2",
"version": 3
],
]
def amiid = "BOOYA"
apps.values().each { app ->
// app is a map with keys [repos, name, version]
job {
name app.name
if (app.repos.size() == 1) {
scm {
git(app.repos.get(0))
}
} else {
multiscm {
app.repos.each { repo ->
git(repo)
}
}
}
parameters {
stringParam("APPNAME", app.name, "")
stringParam("APPVER", (String) app.version,"")
stringParam("AMIID", amiid, "")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment