summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2018-06-21 20:15:16 -0400
committerTim Rozet <trozet@redhat.com>2018-06-21 20:15:16 -0400
commit3dd625926e04a3791acd006f83be17dc3fd8979e (patch)
tree77d305e713452ef23db3819dcfeca776da76a676
parent4c34259866bd34d79fb5a100b8355404d9eca36a (diff)
Apex: more snapshot fixes
Changes-Include: - Rename jobs to have 'os' in them to distinguish openstack branch - Fix uploading snapshots to upload from the create directory (where the artifacts are built and stored) - Fix the properties file so that it is created if one does not exist already upstream in the artifacts repo Change-Id: I0d75fd41585538cbe860274a082cb4051d8b05c5 Signed-off-by: Tim Rozet <trozet@redhat.com>
-rw-r--r--jjb/apex/apex-snapshot-create.sh12
-rwxr-xr-xjjb/apex/apex-upload-artifact.sh7
-rw-r--r--jjb/apex/apex.yaml4
-rw-r--r--jjb/apex/apex.yaml.j24
4 files changed, 18 insertions, 9 deletions
diff --git a/jjb/apex/apex-snapshot-create.sh b/jjb/apex/apex-snapshot-create.sh
index 7e38d56b4..b73931470 100644
--- a/jjb/apex/apex-snapshot-create.sh
+++ b/jjb/apex/apex-snapshot-create.sh
@@ -91,10 +91,16 @@ echo "Snapshot saved as apex-${SNAP_TYPE}-snap-${DATE}.tar.gz"
# update opnfv properties file
if [ "$SNAP_TYPE" == 'csit' ]; then
- curl -O -L http://$GS_URL/snapshot.properties
- sed -i '/^OPNFV_SNAP_URL=/{h;s#=.*#='${GS_URL}'/apex-csit-snap-'${DATE}'.tar.gz#};${x;/^$/{s##OPNFV_SNAP_URL='${GS_URL}'/apex-csit-snap-'${DATE}'.tar.gz#;H};x}' snapshot.properties
snap_sha=$(sha512sum apex-csit-snap-${DATE}.tar.gz | cut -d' ' -f1)
- sed -i '/^OPNFV_SNAP_SHA512SUM=/{h;s/=.*/='${snap_sha}'/};${x;/^$/{s//OPNFV_SNAP_SHA512SUM='${snap_sha}'/;H};x}' snapshot.properties
+ if curl --fail -O -L http://$GS_URL/snapshot.properties; then
+ sed -i '/^OPNFV_SNAP_URL=/{h;s#=.*#='${GS_URL}'/apex-csit-snap-'${DATE}'.tar.gz#};${x;/^$/{s##OPNFV_SNAP_URL='${GS_URL}'/apex-csit-snap-'${DATE}'.tar.gz#;H};x}' snapshot.properties
+ sed -i '/^OPNFV_SNAP_SHA512SUM=/{h;s/=.*/='${snap_sha}'/};${x;/^$/{s//OPNFV_SNAP_SHA512SUM='${snap_sha}'/;H};x}' snapshot.properties
+ else
+ cat << EOF > snapshot.properties
+OPNFV_SNAP_URL=${GS_URL}/apex-csit-snap-${DATE}.tar.gz
+OPNFV_SNAP_SHA512SUM=${snap_sha}
+EOF
+ fi
echo "OPNFV_SNAP_URL=$GS_URL/apex-csit-snap-${DATE}.tar.gz"
echo "OPNFV_SNAP_SHA512SUM=$(sha512sum apex-csit-snap-${DATE}.tar.gz | cut -d' ' -f1)"
echo "Updated properties file: "
diff --git a/jjb/apex/apex-upload-artifact.sh b/jjb/apex/apex-upload-artifact.sh
index 6acb2a582..5c777a824 100755
--- a/jjb/apex/apex-upload-artifact.sh
+++ b/jjb/apex/apex-upload-artifact.sh
@@ -77,13 +77,16 @@ uploadrpm () {
uploadsnap () {
# Uploads snapshot artifact and updated properties file
echo "Uploading snapshot artifacts"
+ # snapshot dir is the same node in the create job workspace
+ # only 1 promotion job can run at a time on a slave
+ snapshot_dir="${WORKSPACE}/../apex-create-snapshot"
if [ -z "$SNAP_TYPE" ]; then
echo "ERROR: SNAP_TYPE not provided...exiting"
exit 1
fi
- gsutil cp $WORKSPACE/apex-${SNAP_TYPE}-snap-`date +%Y-%m-%d`.tar.gz gs://$GS_URL/ > gsutil.iso.log
+ gsutil cp ${snapshot_dir}/apex-${SNAP_TYPE}-snap-`date +%Y-%m-%d`.tar.gz gs://$GS_URL/ > gsutil.iso.log
if [ "$SNAP_TYPE" == 'csit' ]; then
- gsutil cp $WORKSPACE/snapshot.properties gs://$GS_URL/snapshot.properties > gsutil.latest.log
+ gsutil cp ${snapshot_dir}/snapshot.properties gs://$GS_URL/snapshot.properties > gsutil.latest.log
fi
echo "Upload complete for Snapshot"
}
diff --git a/jjb/apex/apex.yaml b/jjb/apex/apex.yaml
index 249fb0a90..65e558820 100644
--- a/jjb/apex/apex.yaml
+++ b/jjb/apex/apex.yaml
@@ -8,7 +8,7 @@
- 'apex-virtual-{stream}'
- 'apex-deploy-{platform}-{stream}'
- 'apex-daily-{stream}'
- - 'apex-csit-promote-daily-{stream}-{os_version}'
+ - 'apex-csit-promote-daily-{stream}-os-{os_version}'
- 'apex-fdio-promote-daily-{stream}'
- 'apex-{scenario}-baremetal-{scenario_stream}'
- 'apex-testsuite-{scenario}-baremetal-{scenario_stream}'
@@ -777,7 +777,7 @@
# CSIT promote
- job-template:
- name: 'apex-csit-promote-daily-{stream}-{os_version}'
+ name: 'apex-csit-promote-daily-{stream}-os-{os_version}'
# Job template for promoting CSIT Snapshots
#
diff --git a/jjb/apex/apex.yaml.j2 b/jjb/apex/apex.yaml.j2
index 166e7a07b..f1208d27e 100644
--- a/jjb/apex/apex.yaml.j2
+++ b/jjb/apex/apex.yaml.j2
@@ -8,7 +8,7 @@
- 'apex-virtual-{stream}'
- 'apex-deploy-{platform}-{stream}'
- 'apex-daily-{stream}'
- - 'apex-csit-promote-daily-{stream}-{os_version}'
+ - 'apex-csit-promote-daily-{stream}-os-{os_version}'
- 'apex-fdio-promote-daily-{stream}'
- 'apex-{scenario}-baremetal-{scenario_stream}'
- 'apex-testsuite-{scenario}-baremetal-{scenario_stream}'
@@ -649,7 +649,7 @@
# CSIT promote
- job-template:
- name: 'apex-csit-promote-daily-{stream}-{os_version}'
+ name: 'apex-csit-promote-daily-{stream}-os-{os_version}'
# Job template for promoting CSIT Snapshots
#