X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=ci-management.git;a=blobdiff_plain;f=jjb%2Fshell%2Fmake-tar.sh;h=adc830d010d294093178f2cbf2f516665e9c7850;hp=79e7e6d375afef55eaab9b0163afdc55c59a4368;hb=683452330b0784c355d032aae4454674d7fdc60e;hpb=d4e2961f7e52af1ad5bff7fb8e87423412d1f1c5 diff --git a/jjb/shell/make-tar.sh b/jjb/shell/make-tar.sh index 79e7e6d..adc830d 100644 --- a/jjb/shell/make-tar.sh +++ b/jjb/shell/make-tar.sh @@ -20,25 +20,40 @@ dos2unix "${WORKSPACE}/version.properties" source "$WORKSPACE/version.properties" TARDIR=$UPLOAD_FILES_PATH -set -e -u -x -o pipefail +# STAGING_BUILD (below) may be unset +set -e +u -x -o pipefail rm -fr "$TARDIR" -mkdir "$TARDIR" + +if [ -n "$STAGING_BUILD" ] +then + # Remove the "-SNAPSHOT" from the version for a staging build + VERSION=$(echo "$VERSION" | sed 's/-SNAPSHOT//') +else + # Make sure the version has the "-SNAPSHOT" on the end for other builds + [[ ! "$VERSION" =~ -SNAPSHOT$ ]] && VERSION="${VERSION}-SNAPSHOT" +fi + +# STAGING_BUILD not used past this point +set -u if [ "$PROJECT" == "addon-onap" ] then + # Make sure $TARDIR is an absolute path + mkdir "$TARDIR" + [[ "$TARDIR" != /* ]] && TARDIR="$PWD/$TARDIR" + # ONAP addon is special. # Build the regional controller scripts tar ball - # NOTE: Remove the two "-SNAPSHOT" below when the ONAP version.properties is fixed. ARTIFACT_NAME="onap-amsterdam-regional-controller-${STREAM}" - TAR_NAME="${ARTIFACT_NAME}-${VERSION}-SNAPSHOT.tgz" + TAR_NAME="${ARTIFACT_NAME}-${VERSION}.tgz" echo "Making tar file ${TARDIR}/${TAR_NAME}" cd ./src/regional_controller_scripts/ tar -cvzf "${TARDIR}/${TAR_NAME}" -- * # Build the ONAP VM scripts tar ball ARTIFACT_NAME="onap-amsterdam-VM-${STREAM}" - TAR_NAME="${ARTIFACT_NAME}-${VERSION}-SNAPSHOT.tgz" + TAR_NAME="${ARTIFACT_NAME}-${VERSION}.tgz" echo "Making tar file ${TARDIR}/${TAR_NAME}" cd ../onap_vm_scripts/ tar -cvzf "${TARDIR}/${TAR_NAME}" -- * @@ -47,7 +62,10 @@ else TAR_NAME="${PROJECT}-${VERSION}.tgz" echo "Making tar file ${TARDIR}/${TAR_NAME}" - tar -cvzf "${TARDIR}/${TAR_NAME}" -- * + # Put the file in /tmp initially to prevent it $TARDIR from going into the tar file + tar -cvzf "/tmp/${TAR_NAME}" -- * + mkdir "$TARDIR" + cp "/tmp/${TAR_NAME}" "${TARDIR}/${TAR_NAME}" fi set +u +x