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

Commit

Permalink
Merge #544
Browse files Browse the repository at this point in the history
544: [backports/1.3/ci] backport ci updates r=anguslees a=sameersbn



Co-authored-by: Sameer Naik <sameer@bitnami.com>
  • Loading branch information
bors[bot] and Sameer Naik committed May 17, 2019
2 parents 5171de3 + 96b5b5b commit a118073
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def label = env.BUILD_TAG.replaceAll(/[^a-zA-Z0-9-]/, '-').toLowerCase()

def scmCheckout() {
def repo_url = env.GITHUB_REPO_GIT_URL
def sha = env.GITHUB_PR_HEAD_SHA ? env.GITHUB_PR_HEAD_SHA : env.GITHUB_BRANCH_HEAD_SHA
def sha = env.GITHUB_PR_HEAD_SHA ?: (env.GITHUB_BRANCH_HEAD_SHA ?: env.GITHUB_TAG_HEAD_SHA)

sh """
git init --quiet
Expand All @@ -32,23 +32,11 @@ def scmCheckout() {

def scmPostCommitStatus(String state) {
def target_url = env.BUILD_URL + 'display/redirect'
def repo = ''
def sha = ''
def context = ''
def sha = env.GITHUB_PR_HEAD_SHA ?: (env.GITHUB_BRANCH_HEAD_SHA ?: env.GITHUB_TAG_HEAD_SHA)
def context = 'continuous-integration/jenkins/' + (env.GITHUB_BRANCH_NAME ? 'branch' : (env.GITHUB_TAG_NAME ? 'tag' : 'pr-merge'))
def params = (env.GITHUB_PR_URL ?: (env.GITHUB_BRANCH_URL ?: env.GITHUB_TAG_URL)).replaceAll('https://github.com/', '').split('/')
def repo = params[0] + '/' + params[1]
def desc = ''
def url = ''

if(env.GITHUB_BRANCH_NAME != null) {
sha = env.GITHUB_BRANCH_HEAD_SHA
url = env.GITHUB_BRANCH_URL
context = 'continuous-integration/jenkins/branch'
} else {
sha = env.GITHUB_PR_HEAD_SHA
url = env.GITHUB_PR_URL
context = 'continuous-integration/jenkins/pr-merge'
}
params = url.replaceAll('https://github.com/', '').split('/');
repo = params[0] + '/' + params[1]

switch(state) {
case 'success':
Expand Down

0 comments on commit a118073

Please sign in to comment.