aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Rendina <mrendina@stsci.edu>2019-01-08 17:16:46 -0500
committerMatt Rendina <rendinam@users.noreply.github.com>2019-01-08 17:37:37 -0500
commitfe515620afebeb3210ccd7a910b9b94edb0a9274 (patch)
tree570a15459ffcee1949cff4d75ad03b658eaeb80b
parent076de3070eefec37c4d1110059becdc3cd0befba (diff)
downloadbuild_control-fe515620afebeb3210ccd7a910b9b94edb0a9274.tar.gz
Purge indexing lockfile shortly after job starts.
-rw-r--r--jenkins/dispatch.groovy17
1 files changed, 12 insertions, 5 deletions
diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy
index cdc5f2c..584352d 100644
--- a/jenkins/dispatch.groovy
+++ b/jenkins/dispatch.groovy
@@ -52,6 +52,7 @@ node(LABEL) {
// The directory deleted is the one named after the jenkins pipeline job.
deleteDir()
+
this.OSname = null
def uname = sh(script: "uname", returnStdout: true).trim()
if (uname == "Darwin") {
@@ -104,6 +105,12 @@ node(LABEL) {
writeFile file: MANIFEST_FILE, text: manifest_data, encoding: "UTF-8"
}
+ // Delete any existing indexing lockfile which may have
+ // been left behind by a previously aborted job.
+ this.publication_path = "${this.manifest.publication_root}/${this.CONDA_PLATFORM}"
+ this.lockfile = "${publication_path}/LOCK-Jenkins"
+ sh(script: "rm ${this.lockfile}", returnStatus: true)
+
// Check for existence of version pins file.
this.use_version_pins = 'false'
if (fileExists("jenkins/${this.version_pins_file}")) {
@@ -343,7 +350,7 @@ node(LABEL) {
}
stage ("Publish") {
- def publication_path = "${this.manifest.publication_root}/${this.CONDA_PLATFORM}"
+ ////def publication_path = "${this.manifest.publication_root}/${this.CONDA_PLATFORM}"
// Copy and index packages if any were produced in the build.
def artifacts_present =
sh(script: "ls ${this.conda_build_output_dir}/*.tar.bz2 >/dev/null 2>&1",
@@ -354,20 +361,20 @@ node(LABEL) {
// Use a lock file to prevent two dispatch jobs that finish at the same
// time from trampling each other's indexing process.
def tries_remaining = this.max_publication_tries
- def lockfile = "${publication_path}/LOCK-Jenkins"
- if ( fileExists(lockfile) ) {
+ ////def lockfile = "${publication_path}/LOCK-Jenkins"
+ if ( fileExists(this.lockfile) ) {
println("Lockfile already exists, waiting for it to be released...")
while ( tries_remaining > 0) {
println("Waiting ${this.publication_lock_wait_s}s for lockfile release...")
sleep(this.publication_lock_wait_s)
- if ( !fileExists(lockfile) ) {
+ if ( !fileExists(this.lockfile) ) {
break
}
tries_remaining--
}
}
if (tries_remaining != 0) {
- sh(script: "touch ${lockfile}")
+ sh(script: "touch ${this.lockfile}")
def index_cmd = "conda index"
def version_vals = []
CONDA_BUILD_VERSION.tokenize('.').each { value -> version_vals.add(value.toInteger()) }