ci/steps.groovy
branchstx-8.0.0
changeset 223 575d0458b5c0
parent 222 80f098bd53ca
child 231 9ba1d7cc7c61
--- a/ci/steps.groovy	Mon Mar 12 22:08:46 2018 +0000
+++ b/ci/steps.groovy	Thu Mar 15 09:44:04 2018 +0000
@@ -69,13 +69,14 @@
         matrix ( configurations ) {
             stage ( "Checkout - {${env.BUILD_TARGET}} " ) {
                 sshagent([ scm.getCredentialsId() ]) {
+                    branch_to_use = branch != null ? branch : scm.getBranch()
                     sh  """
                         if [ -f build.rb ]; then
                             hg pull --ssh ssh ${scm.getSource()}
                         else
                             hg clone --ssh ssh ${scm.getSource()} .
                         fi
-                        hg up ${branch != null ? branch : scm.getBranch()}
+                        hg up ${branch_to_use}
                         """
                     sh  "ruby build.rb --project \"stx:jv-branch\" --build-target ${env.BUILD_TARGET} update"
                 }
@@ -111,18 +112,12 @@
     }
 
     /*
-     * Build all artifacts - to allow Pocho to run full St/X without
+     * Build and publish all artifacts - to allow (beta) testers to run full St/X without
      * a need to build it itself
      */
-    // stage ( "Artifacts (stx & librun)")
-    // matrix ( configurations ) {
-    //     stage ( "Artifacts (stx & librun) - {${env.BUILD_TARGET}}") {
-    //         sh "ruby build.rb --project \"stx:jv-branch\" --build-target ${env.BUILD_TARGET} artifacts:prebuilt-stc"
-    //         sh "ruby build.rb --project \"stx:jv-branch\" --build-target ${env.BUILD_TARGET} artifacts:prebuilt-librun"
-    //         archiveArtifacts artifacts: "artifacts/*build${env.BUILD_NUMBER}*.zip, artifacts/*build${env.BUILD_NUMBER}*.bz2, artifacts/*build${env.BUILD_NUMBER}*.sha256", fingerprint: true//, onlyIfSuccessful: true
-    //     }
-    // }
     artifacts();
+    input(message: 'Publish artifacts?')
+    publish("8.0.0-rc")
 }
 
 /*
@@ -157,6 +152,31 @@
 }
 
 /*
+ * Publish built artifacts to download server
+ */
+def publish(dir) {
+    Calendar current = Calendar.getInstance()
+    Calendar scheduled = current.clone()
+
+    /*
+     * Schedule the upload to the next day, 3am in the morning
+     */
+    scheduled.add(Calendar.DATE, 1)
+    scheduled.set(Calendar.HOUR_OF_DAY, 3)
+
+    build(job:        'stx_jv_publish',
+          parameters: [
+                        string(name: 'job', value: env.JOB_NAME),
+                        string(name: 'srv', value: env.STX_PUBLISH_SERVER),
+                        string(name: 'dir', value: "${env.STX_PUBLISH_DIRECTORY}/${dir}")
+                      ],
+          quietPeriod: (scheduled.getTimeInMillis() - current.getTimeInMillis()) / 1000,
+          wait: false)
+}
+
+
+
+/*
  * Utility. Return true, if there are any changes to be pushed to an upstream,
  * false othervise.
  */