aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Rendina <mrendina@stsci.edu>2017-08-03 11:19:08 -0400
committerMatt Rendina <mrendina@stsci.edu>2017-08-03 11:19:08 -0400
commit187fe2e8627fbdcebe585b5c3b07f3b9480e3287 (patch)
tree4820595acb57d757ebd1cc7698b0d95a598eec8c
parent5e1ca1b50d6dda10ac9af4b3f3102e3d62888bf8 (diff)
downloadbuild_control-187fe2e8627fbdcebe585b5c3b07f3b9480e3287.tar.gz
Lockfile test
-rw-r--r--jenkins/dispatch.groovy12
1 files changed, 5 insertions, 7 deletions
diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy
index 05ff914..03cdad6 100644
--- a/jenkins/dispatch.groovy
+++ b/jenkins/dispatch.groovy
@@ -241,13 +241,11 @@ node(LABEL) {
//sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${PUBLICATION_PATH}")
// Use a lock file to prevent two dispatch jobs that finish at the same
// time from trampling each other's indexing process.
- sh(script: "touch ${PUBLICATION_PATH}/LOCK-Jenkins")
- //PrintWriter writer = null
- //f = new File("${PUBLICATION_PATH}/LOCK-Jenkins")
- ////f = new File("${PUBLICATION_PATH}/${this.CONDA_PLATFORM}/LOCK-Jenkins")
- //writer = new PrintWriter(f)
- //writer.println("Lock file output")
- //writer.close()
+ def lockfile = "${PUBLICATION_PATH}/${this.CONDA_PLATFORM}/LOCK-Jenkins"
+ def file = new File(lockfile)
+ if ( !file.exists() ) {
+ sh(script: "touch ${lockfile}")
+ }
//dir(this.conda_build_output_dir) {
// sh(script: "conda index")
//}