Skip to content

Commit

Permalink
feat(script): allow script stages to customize branch
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaslin committed Apr 4, 2017
1 parent 9e9c0c0 commit f842e16
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -52,6 +52,7 @@ class StartScriptTask implements Task {
String cluster = stage.context.cluster
String cmc = stage.context.cmc
String repoUrl = stage.context.repoUrl
String repoBranch = stage.context.repoBranch

if (stage.execution instanceof Pipeline && stage.execution.trigger.parameters?.strategy == true) {
Map trigger = ((Pipeline) stage.execution).trigger
Expand All @@ -75,6 +76,10 @@ class StartScriptTask implements Task {
parameters.REPO_URL = repoUrl
}

if (repoBranch) {
parameters.REPO_BRANCH = repoBranch
}

String queuedBuild = buildService.build(master, job, parameters)
new TaskResult(ExecutionStatus.SUCCEEDED, [master: master, job: job, queuedBuild: queuedBuild])
}
Expand Down

0 comments on commit f842e16

Please sign in to comment.