summaryrefslogtreecommitdiffstats
path: root/jjb/apex/apex-upload-artifact.sh
diff options
context:
space:
mode:
Diffstat (limited to 'jjb/apex/apex-upload-artifact.sh')
-rwxr-xr-xjjb/apex/apex-upload-artifact.sh21
1 files changed, 13 insertions, 8 deletions
diff --git a/jjb/apex/apex-upload-artifact.sh b/jjb/apex/apex-upload-artifact.sh
index 4a2a64d68..e93a46b74 100755
--- a/jjb/apex/apex-upload-artifact.sh
+++ b/jjb/apex/apex-upload-artifact.sh
@@ -3,8 +3,13 @@ set -o errexit
set -o nounset
set -o pipefail
+if [ -z "$ARTIFACT_TYPE" ]; then
+ echo "ERROR: ARTIFACT_TYPE not provided...exiting"
+ exit 1
+fi
+
# log info to console
-echo "Uploading the Apex $1 artifact. This could take some time..."
+echo "Uploading the Apex ${ARTIFACT_TYPE} artifact. This could take some time..."
echo "--------------------------------------------------------"
echo
@@ -84,25 +89,25 @@ uploadsnap () {
echo "Upload complete for Snapshot"
}
-if echo $WORKSPACE | grep promote > /dev/null; then
+if [ "$ARTIFACT_TYPE" == 'snapshot' ]; then
uploadsnap
elif gpg2 --list-keys | grep "opnfv-helpdesk@rt.linuxfoundation.org"; then
echo "Signing Key avaliable"
- if [ $1 == 'iso' ]; then
+ if [ "$ARTIFACT_TYPE" == 'iso' ]; then
signiso
uploadiso
fi
- if [ $1 == 'rpm' ]; then
+ if [ "$ARTIFACT_TYPE" == 'rpm' ]; then
signrpm
uploadrpm
fi
else
- if [ $1 == 'iso' ]; then uploadiso; fi
- if [ $1 == 'rpm' ]; then uploadrpm; fi
+ if [ "$ARTIFACT_TYPE" == 'iso' ]; then uploadiso; fi
+ if [ "$ARTIFACT_TYPE" == 'rpm' ]; then uploadrpm; fi
fi
echo
echo "--------------------------------------------------------"
echo "Done!"
-if [ $1 == 'iso' ]; then echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"; fi
-if [ $1 == 'rpm' ]; then echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"; fi
+if [ "$ARTIFACT_TYPE" == 'iso' ]; then echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"; fi
+if [ "$ARTIFACT_TYPE" == 'rpm' ]; then echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"; fi