Skip to content

Commit 311effe

Browse files
author
Vaughn Dice
authored
Merge pull request #109 from vdice/use-env-branch-name
fix(Jenkinsfile): set git_branch to env.BRANCH_NAME
2 parents de2ae41 + 0e0038b commit 311effe

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Jenkinsfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ stage 'Go & Git Info'
3030
node('linux') {
3131
checkout scm
3232

33-
git_branch = sh(returnStdout: true, script: 'git describe --all').trim()
33+
git_branch = env.BRANCH_NAME
3434
git_commit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim()
3535

36-
if (git_branch != "remotes/origin/master") {
36+
if (git_branch != "master") {
3737
// Determine actual PR commit, if necessary
3838
merge_commit_parents= sh(returnStdout: true, script: 'git rev-parse HEAD | git log --pretty=%P -n 1 --date-order').trim()
3939
if (merge_commit_parents.length() > 40) {
@@ -77,7 +77,7 @@ node('linux') {
7777
credentialsId: '2da033eb-2e34-4efd-b090-ad892f348065',
7878
variable: 'CODECOV_TOKEN']]) {
7979
def codecov = "codecov -Z -C ${git_commit} "
80-
if (git_branch == "remotes/origin/master") {
80+
if (git_branch == "master") {
8181
codecov += "-B master"
8282
} else {
8383
def branch_name = env.BRANCH_NAME
@@ -128,7 +128,7 @@ node('linux') {
128128
def author = "deis"
129129
def flags = ""
130130

131-
if (git_branch != "remotes/origin/master") {
131+
if (git_branch != "master") {
132132
author = env.CHANGE_AUTHOR
133133
echo "Skipping build of 386 binaries to shorten CI for Pull Requests"
134134
flags += "-e BUILD_ARCH=amd64"
@@ -158,7 +158,7 @@ stage 'Trigger e2e tests'
158158

159159
waitUntil {
160160
try {
161-
def chartRepoType = git_branch == "remotes/origin/master" ? 'dev' : 'pr'
161+
def chartRepoType = git_branch == "master" ? 'dev' : 'pr'
162162
build job: 'workflow-chart-e2e', parameters: [
163163
[$class: 'StringParameterValue', name: 'WORKFLOW_CLI_SHA', value: git_commit],
164164
[$class: 'StringParameterValue', name: 'ACTUAL_COMMIT', value: git_commit],
@@ -167,7 +167,7 @@ waitUntil {
167167
[$class: 'StringParameterValue', name: 'UPSTREAM_SLACK_CHANNEL', value: '#controller']]
168168
true
169169
} catch(error) {
170-
if (git_branch == "remotes/origin/master") {
170+
if (git_branch == "master") {
171171
throw error
172172
}
173173

0 commit comments

Comments
 (0)