engine: Include stack version in installer filename
Change-Id: I8564a495dc1c0e5dd9d2c29621d190de9ec5327d
diff --git a/jjb/engine/scripts/download-artifact.sh b/jjb/engine/scripts/download-artifact.sh
index 68e8d03..9b3aebf 100755
--- a/jjb/engine/scripts/download-artifact.sh
+++ b/jjb/engine/scripts/download-artifact.sh
@@ -23,22 +23,24 @@
if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then
# ensure we delete leftovers due to lack of disk space
- sudo /bin/rm -rf /tmp/$INSTALLER_FILE ~/.ara \
+ sudo /bin/rm -rf $OFFLINE_INSTALLER_FILE ~/.ara \
/opt/test /opt/stack /httpboot > /dev/null 2>&1 || true
sudo docker ps -a --format {{.ID}} | xargs -n 1 sudo docker stop > /dev/null 2>&1 || true
sudo docker ps -a --format {{.ID}} | xargs -n 1 sudo docker rm > /dev/null 2>&1 || true
sudo docker images -a --format {{.ID}} | xargs -n 1 sudo docker rmi -f > /dev/null 2>&1 || true
sudo docker volume rm $(sudo docker volume ls -qf dangling=true) > /dev/null 2>&1 || true
+ REMOTE_ARTIFACT=$(echo $OFFLINE_INSTALLER_FILE | sed 's/.*\///g')
+
echo "Info : Downloading artifact from Nordix ARM..."
- echo " $NORDIX_ARTIFACT_URL/$INSTALLER_FILE"
+ echo " $NORDIX_ARTIFACT_URL/$REMOTE_ARTIFACT"
cd /tmp
- curl -s -S -O $NORDIX_ARTIFACT_URL/$INSTALLER_FILE
+ curl -s -S -O $NORDIX_ARTIFACT_URL/$REMOTE_ARTIFACT
echo "Info : Downloaded the artifact for offline deployment. Extracting..."
- echo " $(ls -al /tmp/$INSTALLER_FILE)"
- chmod +x /tmp/$INSTALLER_FILE
- /tmp/$INSTALLER_FILE
- sudo /bin/rm -rf /tmp/$INSTALLER_FILE
+ echo " $(ls -al $OFFLINE_INSTALLER_FILE)"
+ chmod +x $OFFLINE_INSTALLER_FILE
+ $OFFLINE_INSTALLER_FILE
+ sudo /bin/rm -rf $OFFLINE_INSTALLER_FILE
else
echo "Info : Online deployment. Skipping artifact download."
fi
diff --git a/jjb/engine/scripts/generate-change-metadata.sh b/jjb/engine/scripts/generate-change-metadata.sh
index ead0a77..0e51011 100755
--- a/jjb/engine/scripts/generate-change-metadata.sh
+++ b/jjb/engine/scripts/generate-change-metadata.sh
@@ -157,8 +157,8 @@
export NORDIX_ARM_HTTPS_URL="https://artifactory.nordix.org/artifactory"
export ARTIFACT_ARM_FOLDER="gerrit"
export BUILD_IDENTIFIER=$GERRIT_CHANGE_NUMBER
-export INSTALLER_FILE="${STACK_TYPE}-${DISTRO}.bsx"
-export BUILD_ARTIFACTS="${STACK_TYPE}-${DISTRO}.bsx"
+export OFFLINE_INSTALLER_FILE="/tmp/${STACK_TYPE}-${GERRIT_BRANCH}-${DISTRO}.bsx"
+export BUILD_ARTIFACTS="/tmp/${STACK_TYPE}-${GERRIT_BRANCH}-${DISTRO}.bsx"
export NORDIX_ARM_REPO="nordix-${STACK_TYPE}"
export NORDIX_ARTIFACT_URL="$NORDIX_ARM_HTTPS_URL/$NORDIX_ARM_REPO/installer/oss/$ARTIFACT_ARM_FOLDER/$BUILD_IDENTIFIER"
@@ -169,8 +169,8 @@
DISTRO=$DISTRO
CI_LOOP=$CI_LOOP
ENGINE_SHA=$(git rev-parse HEAD)
-INSTALLER_FILE=${STACK_TYPE}-ubuntu1804.bsx
-BUILD_ARTIFACTS=${STACK_TYPE}-ubuntu1804.bsx
+OFFLINE_INSTALLER_FILE=$OFFLINE_INSTALLER_FILE
+BUILD_ARTIFACTS=$BUILD_ARTIFACTS
NORDIX_ARM_REPO=nordix-${STACK_TYPE}
NORDIX_ARTIFACT_URL=$NORDIX_ARTIFACT_URL
EOF
diff --git a/jjb/engine/scripts/upload-artifact.sh b/jjb/engine/scripts/upload-artifact.sh
index fe23742..b63a024 100755
--- a/jjb/engine/scripts/upload-artifact.sh
+++ b/jjb/engine/scripts/upload-artifact.sh
@@ -32,6 +32,9 @@
ARTIFACT_SHASUM=$(shasum $BUILD_ARTIFACT | cut -d' ' -f1)
ARTIFACT_SHA256SUM=$(sha256sum $BUILD_ARTIFACT | cut -d' ' -f1)
+ # NOTE (fdegir): get rid of /tmp from BUILD_ARTIFACT
+ REMOTE_ARTIFACT=$(echo $BUILD_ARTIFACT | sed 's/.*\///g')
+
echo "Info : Uploading $BUILD_ARTIFACT to Nordix Artifactory"
curl -s -S \
-H "X-JFrog-Art-Api:$NORDIX_ARM_TOKEN" \
@@ -39,8 +42,8 @@
-H "X-Checksum-Sha1:$ARTIFACT_SHASUM" \
-H "X-Checksum-Sha256:$ARTIFACT_SHA256SUM" \
-T $BUILD_ARTIFACT \
- "$NORDIX_ARTIFACT_URL/$BUILD_ARTIFACT"
- echo "Info : Artifact $BUILD_ARTIFACT is available on $NORDIX_ARTIFACT_URL/$BUILD_ARTIFACT"
+ "$NORDIX_ARTIFACT_URL/$REMOTE_ARTIFACT"
+ echo "Info : Artifact $BUILD_ARTIFACT is available on $NORDIX_ARTIFACT_URL/$REMOTE_ARTIFACT"
done
else
echo "Info : Online deployment. No artifact to upload."