Jenkins: Specify branch name with LocalBranch
This commit is contained in:
4
.ci/Jenkinsfile
vendored
4
.ci/Jenkinsfile
vendored
@@ -79,8 +79,9 @@ def anyFailure = false
|
|||||||
|
|
||||||
def gitClone() {
|
def gitClone() {
|
||||||
/* Read git tag from environment or set the default one. */
|
/* Read git tag from environment or set the default one. */
|
||||||
|
def branch = 'master'
|
||||||
if (env.GIT_COMMIT == null)
|
if (env.GIT_COMMIT == null)
|
||||||
env.GIT_COMMIT = 'master'
|
env.GIT_COMMIT = branch
|
||||||
println "[-] Using git tag [${env.GIT_COMMIT}]"
|
println "[-] Using git tag [${env.GIT_COMMIT}]"
|
||||||
|
|
||||||
/* Clean workspace. */
|
/* Clean workspace. */
|
||||||
@@ -91,6 +92,7 @@ def gitClone() {
|
|||||||
/* Perform clone/checkout. */
|
/* Perform clone/checkout. */
|
||||||
def scmVars = checkout scm: [$class: 'GitSCM',
|
def scmVars = checkout scm: [$class: 'GitSCM',
|
||||||
branches: [[name: env.GIT_COMMIT]],
|
branches: [[name: env.GIT_COMMIT]],
|
||||||
|
extensions: [[$class: 'LocalBranch', localBranch: branch]],
|
||||||
userRemoteConfigs: [[url: 'https://github.com/86Box/86Box.git']]]
|
userRemoteConfigs: [[url: 'https://github.com/86Box/86Box.git']]]
|
||||||
env.GIT_COMMIT = scmVars.GIT_COMMIT
|
env.GIT_COMMIT = scmVars.GIT_COMMIT
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user