From c1ec758bf33c79d2b28cf26202ede0ccb0360787 Mon Sep 17 00:00:00 2001
From: Michael Krotscheck <krotscheck@gmail.com>
Date: Tue, 28 Jan 2014 13:11:38 -0800
Subject: [PATCH] Updated tarball/client dist upload for javascript

Here we fix a couple of things - firstly that the compiled app only
gets uploaded on success in unit tests. Secondly, that we upload both
a 'recent' tarball and the most recent version tarball of the app.

Change-Id: Ifb7c16f649b36fbebcb061ab2cbd383fada6f960
---
 .../config/javascript.yaml                    | 21 +++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/modules/openstack_project/files/jenkins_job_builder/config/javascript.yaml b/modules/openstack_project/files/jenkins_job_builder/config/javascript.yaml
index d7d6a1c7e1..271e260322 100644
--- a/modules/openstack_project/files/jenkins_job_builder/config/javascript.yaml
+++ b/modules/openstack_project/files/jenkins_job_builder/config/javascript.yaml
@@ -31,10 +31,13 @@
               source: 'reports/**'
               keep-hierarchy: true
               copy-after-failure: true
+
+              # We're uploading the compiled app as a pre-release sanity check,
+              # much like we do with docs builds.
             - target: 'docs-draft/$LOG_PATH'
               source: 'dist/**'
               keep-hierarchy: true
-              copy-after-failure: true
+              copy-after-failure: false
     node: '{node}'
 
 - job-template:
@@ -55,9 +58,14 @@
       - shell: |
           #!/bin/bash -xe
 
+          # Clean/create a tarball directory
+          rm -rf tarballs
+          mkdir -p tarballs
+
+          # Create an archive tarball.
           tar -czf {name}-$PROJECT_VER.tar.gz dist/
-          cp {name}-$PROJECT_VER.tar.gz dist/{name}-latest.tar.gz
-          mv {name}-$PROJECT_VER.tar.gz dist/
+          cp {name}-$PROJECT_VER.tar.gz tarballs/{name}-latest.tar.gz
+          mv {name}-$PROJECT_VER.tar.gz tarballs/
     publishers:
       - console-log
       - coverage-log
@@ -68,7 +76,8 @@
               source: 'reports/**'
               keep-hierarchy: true
               copy-after-failure: true
-      - tarball:
-          project: '{name}'
-          site: '{tarball-site}'
+            - target: 'tarballs/{name}/'
+              source: 'tarballs/*.tar.gz'
+              keep-hierarchy: false
+              copy-after-failure: false
     node: '{node}'