make sure we don't pass origin/ with branch name to child jobs

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2018-08-28 15:01:30 -04:00
parent 3a3a6f2aa5
commit 0bbfe24aec
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
1 changed files with 4 additions and 2 deletions

View File

@ -3,12 +3,14 @@ def version() {
}
def buildBranch(name = null, buildType = params.BUILD_TYPE) {
/* need to drop origin/ to match definitions of child jobs */
def branchName = env.GIT_BRANCH.replace('origin/', '')
/* always pass the BRANCH and BUILD_TYPE params with current branch */
return build(
job: name,
parameters: [
[name: 'BRANCH', value: env.GIT_BRANCH, $class: 'StringParameterValue'],
[name: 'BUILD_TYPE', value: buildType, $class: 'StringParameterValue'],
[name: 'BRANCH', value: branchName, $class: 'StringParameterValue'],
[name: 'BUILD_TYPE', value: buildType, $class: 'StringParameterValue'],
])
}