Jenkins: Switch back to cleaning workspace before build

This commit is contained in:
RichardG867
2021-11-23 23:59:13 -03:00
parent 95f63cc05e
commit 1b60a825dc

22
.ci/Jenkinsfile vendored
View File

@@ -83,6 +83,9 @@ def gitClone() {
env.GIT_COMMIT = 'master'
println "[-] Using git tag [${env.GIT_COMMIT}]"
/* Clean workspace. */
cleanWs()
/* Use stashes to avoid performing multiple clones. */
if (env.GIT_STASHED != 'true') {
/* Perform clone/checkout. */
@@ -168,9 +171,6 @@ pipeline {
try {
gitClone()
} catch (e) {}
try {
cleanWs()
} catch (e) {}
}
}
}
@@ -182,12 +182,7 @@ pipeline {
gitClone()
/* Switch to temp directory. */
dir(WORKSPACE_TMP) {
/* Clean output directory of potential stale old builds. */
removeDir('output')
/* Switch to output directory. */
dir('output') {
dir("${env.WORKSPACE_TMP}/output") {
/* Run source tarball creation process. */
def packageName = "${env.JOB_BASE_NAME}-Source-b${env.BUILD_NUMBER}"
runBuild("-s \"$packageName\"")
@@ -195,7 +190,6 @@ pipeline {
/* Archive resulting artifacts. */
archiveArtifacts artifacts: "$packageName*"
}
}
} catch (e) {
/* Mark that a failure occurred. */
anyFailure = true
@@ -221,13 +215,8 @@ pipeline {
/* Run git clone. */
gitClone()
/* Switch to temp directory. */
dir(WORKSPACE_TMP) {
/* Clean output directory of potential stale old builds. */
removeDir('output')
/* Switch to output directory. */
dir('output') {
dir("${env.WORKSPACE_TMP}/output") {
/* Run build process. */
def packageName = "${env.JOB_BASE_NAME}${dynarecSlugs[dynarec]}${presetSlugs[preset]}-$os-$arch-b${env.BUILD_NUMBER}"
dir("${dynarecNames[dynarec]}/$os - ${archNames[arch]}") {
@@ -237,7 +226,6 @@ pipeline {
/* Archive resulting artifacts. */
archiveArtifacts artifacts: "**/**/$packageName*"
}
}
} catch (e) {
/* Mark that a failure occurred. */
anyFailure = true