Another attempt at fixing the Jenkins mess
This commit is contained in:
36
.ci/Jenkinsfile
vendored
36
.ci/Jenkinsfile
vendored
@@ -15,6 +15,9 @@
|
|||||||
* Copyright 2021 RichardG.
|
* Copyright 2021 RichardG.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
def repository = 'https://github.com/86Box/86Box.git'
|
||||||
|
def branch = 'master'
|
||||||
|
|
||||||
def osArchs = [
|
def osArchs = [
|
||||||
'Windows': ['32', '64'],
|
'Windows': ['32', '64'],
|
||||||
'Linux': ['x86', 'x86_64', 'arm32', 'arm64']
|
'Linux': ['x86', 'x86_64', 'arm32', 'arm64']
|
||||||
@@ -79,7 +82,6 @@ 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 = branch
|
env.GIT_COMMIT = branch
|
||||||
println "[-] Using git tag [${env.GIT_COMMIT}]"
|
println "[-] Using git tag [${env.GIT_COMMIT}]"
|
||||||
@@ -90,10 +92,12 @@ def gitClone() {
|
|||||||
/* Use stashes to avoid performing multiple clones. */
|
/* Use stashes to avoid performing multiple clones. */
|
||||||
if (env.GIT_STASHED != 'true') {
|
if (env.GIT_STASHED != 'true') {
|
||||||
/* Perform clone/checkout. */
|
/* Perform clone/checkout. */
|
||||||
def scmVars = checkout scm: [$class: 'GitSCM',
|
def scmVars = checkout poll: false,
|
||||||
|
changelog: true,
|
||||||
|
scm: [$class: 'GitSCM',
|
||||||
branches: [[name: env.GIT_COMMIT]],
|
branches: [[name: env.GIT_COMMIT]],
|
||||||
extensions: [[$class: 'LocalBranch', localBranch: branch]],
|
extensions: [[$class: 'LocalBranch', localBranch: branch]],
|
||||||
userRemoteConfigs: [[url: 'https://github.com/86Box/86Box.git']]]
|
userRemoteConfigs: [[url: repository]]]
|
||||||
env.GIT_COMMIT = scmVars.GIT_COMMIT
|
env.GIT_COMMIT = scmVars.GIT_COMMIT
|
||||||
|
|
||||||
/* Stash data and mark it as stashed. */
|
/* Stash data and mark it as stashed. */
|
||||||
@@ -165,15 +169,23 @@ pipeline {
|
|||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the polling log parsing fails, perform a dummy git clone on any node.
|
/* Perform a git clone on any node to save polling data and,
|
||||||
Not quite as fast as reading the polling log, but it works as a backup. */
|
if polling log parsing failed, get the current HEAD commit. */
|
||||||
if (env.GIT_COMMIT == null) {
|
node {
|
||||||
node {
|
/* Clean workspace. */
|
||||||
/* Ignore exceptions again as this is not really critical. */
|
cleanWs()
|
||||||
try {
|
|
||||||
gitClone()
|
/* Perform clone/checkout. */
|
||||||
} catch (e) {}
|
def scmVars = checkout poll: true,
|
||||||
}
|
changelog: false,
|
||||||
|
scm: [$class: 'GitSCM',
|
||||||
|
branches: [[name: branch]],
|
||||||
|
userRemoteConfigs: [[url: repository]]]
|
||||||
|
if (env.GIT_COMMIT == null)
|
||||||
|
env.GIT_COMMIT = scmVars.GIT_COMMIT
|
||||||
|
|
||||||
|
/* Clean workspace again. */
|
||||||
|
cleanWs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user