Created
November 30, 2016 14:37
-
-
Save jjtroberts/2e3482040f6dce72d8decaa8ce1abeb5 to your computer and use it in GitHub Desktop.
Groovy Pipeline Script
This file contains 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 myFolderName = "xxxxxxxxxxxxxx" | |
def mySlug = "xxxxxxxxxxxxxx" | |
def myDisplayName = "xxxxxxxxxxxxxx" | |
// Ensure plugin directory exists so the job dsls succeed | |
folder("platform/themes/${myFolderName}") { | |
displayName("${myDisplayName}") | |
} | |
pipelineJob("platform/themes/${myFolderName}/branch-builder") { | |
definition { | |
quietPeriod(0) | |
logRotator { | |
daysToKeep(-1) | |
numToKeep(5) | |
} | |
parameters { | |
stringParam('parentBranch', '', 'Parent Branch') | |
stringParam('childSlug', "${mySlug}", 'Child Repo Slug') | |
stringParam('childBranch', '', 'Child Branch') | |
choiceParam('gulpBuild', ['Yes', 'No'], 'Gulp Build Required') | |
} | |
cpsScm { | |
scm { | |
git{ | |
remote { | |
name('origin') | |
url('xxxxxxxxxxxx.git') | |
} | |
branch('master') | |
} | |
scriptPath('platform/themes/common/branchBuilder.groovy') | |
} | |
} | |
publishers { | |
slackNotifier { | |
room('jenkins') | |
notifyAborted(true) | |
notifyFailure(true) | |
notifyNotBuilt(true) | |
notifyUnstable(true) | |
notifyBackToNormal(true) | |
notifySuccess(false) | |
notifyRepeatedFailure(false) | |
startNotification(false) | |
includeTestSummary(false) | |
includeCustomMessage(false) | |
customMessage(null) | |
buildServerUrl(null) | |
sendAs(null) | |
commitInfoChoice('NONE') | |
teamDomain(null) | |
authToken(null) | |
} | |
} | |
} | |
} | |
pipelineJob("platform/themes/${myFolderName}/tag-builder") { | |
definition { | |
quietPeriod(0) | |
logRotator { | |
daysToKeep(-1) | |
numToKeep(5) | |
} | |
parameters { | |
stringParam('parentTag', '', 'Parent Tag') | |
stringParam('childSlug', "${mySlug}", 'Child Repo Slug') | |
stringParam('childTag', '', 'Child Tag') | |
choiceParam('gulpBuild', ['Yes', 'No'], 'Gulp Build Required') | |
} | |
cpsScm { | |
scm { | |
git{ | |
remote { | |
name('origin') | |
url('xxxxxxxxxxxxxxxx.git') | |
} | |
branch('master') | |
} | |
scriptPath('platform/themes/common/tagBuilder.groovy') | |
} | |
} | |
publishers { | |
slackNotifier { | |
room('jenkins') | |
notifyAborted(true) | |
notifyFailure(true) | |
notifyNotBuilt(true) | |
notifyUnstable(true) | |
notifyBackToNormal(true) | |
notifySuccess(false) | |
notifyRepeatedFailure(false) | |
startNotification(false) | |
includeTestSummary(false) | |
includeCustomMessage(false) | |
customMessage(null) | |
buildServerUrl(null) | |
sendAs(null) | |
commitInfoChoice('NONE') | |
teamDomain(null) | |
authToken(null) | |
} | |
} | |
} | |
} | |
multibranchPipelineJob("platform/themes/${myFolderName}/multidev") { | |
branchSources { | |
branchSource { | |
source { | |
bitbucketSCMSource { | |
id(mySlug) | |
repoOwner("xxxxxxxxxxxxxxx") | |
repository(mySlug) | |
autoRegisterHook(true) | |
credentialsId(scanCredentials) | |
checkoutCredentialsId(checkoutCredentials) | |
includes("*") | |
sshPort(-1) | |
} | |
} | |
} | |
} | |
orphanedItemStrategy { | |
discardOldItems { | |
numToKeep(0) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment