Skip to content

Commit

Permalink
only rely on params and ghprb for branch info
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed May 18, 2020
1 parent d9d3575 commit 5277397
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions vars/getCheckoutInfo.groovy
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
def call(scmVars) {
def repoInfo = [:]
def call() {

repoInfo.branch = env.ghprbSourceBranch ?: scmVars.GIT_LOCAL_BRANCH ?: scmVars.GIT_BRANCH
repoInfo.targetBranch = env.ghprbTargetBranch
def repoInfo = [
branch: env.ghprbSourceBranch ?: params.branch_specifier ?: 'missing branch_specifier'
targetBranch: env.ghprbTargetBranch
]

dir("kibana") {
repoInfo.commit = sh(
Expand Down
3 changes: 2 additions & 1 deletion vars/workers.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ def base(Map params, Closure closure) {
if (config.scm) {
// Try to clone from Github up to 8 times, waiting 15 secs between attempts
retryWithDelay(8, 15) {
checkoutInfo = getCheckoutInfo(checkout(scm))
checkout scm
}

checkoutInfo = getCheckoutInfo()
ciStats.reportGitInfo(
checkoutInfo.branch,
checkoutInfo.commit,
Expand Down

0 comments on commit 5277397

Please sign in to comment.