Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Commit

Permalink
select the correct branch for pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
luciangabor committed Nov 10, 2017
1 parent b3a7315 commit b93c329
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ pipeline {
build job: "../vamp-docker-images/" + getBranch().replaceAll("/", "%2F"),
parameters: [
[$class: 'StringParameterValue', name: 'VAMP_GIT_ROOT', value: 'git@github.com:' + env.JOB_NAME.split("/").first()],
[$class: 'StringParameterValue', name: 'VAMP_GIT_BRANCH', value: env.BRANCH_NAME]
[$class: 'StringParameterValue', name: 'VAMP_GIT_BRANCH', value: env.BRANCH_NAME],
[$class: 'StringParameterValue', name: 'VAMP_CHANGE_TARGET', value: env.CHANGE_TARGET ?: ''],
[$class: 'StringParameterValue', name: 'VAMP_CHANGE_URL', value: env.CHANGE_URL ?: '']
],
wait: true
}
Expand All @@ -28,7 +30,7 @@ import groovy.json.JsonSlurperClassic
def getBranch() {
def req = httpRequest consoleLogResponseBody: true, httpMode: 'GET', acceptType: 'APPLICATION_JSON', url: "https://api.github.com/repos/${env.JOB_NAME.split("/").first()}/vamp-docker-images/branches", validResponseCodes: '200'

def cur = env.JOB_NAME.split("/").last()
def cur = env.CHANGE_TARGET ?: env.JOB_NAME.split("/").last()
def data = new JsonSlurperClassic().parseText(req.content)
def branches = []
for (item in data) {
Expand Down

0 comments on commit b93c329

Please sign in to comment.