X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=ci-management.git;a=blobdiff_plain;f=jjb%2Fshell%2Fmake-tar.sh;fp=jjb%2Fshell%2Fmake-tar.sh;h=43e5693195984012a16e04103ba7698ebdd5fdef;hp=76d730dca4b7919b8ce3faafaca2db4c5e03d7b3;hb=a32c0135e4a960a16eff2c6b87f8cae1ae68f973;hpb=0e3bc5b8ef09617fe1fdcb0bf7ccd8819fa9009d diff --git a/jjb/shell/make-tar.sh b/jjb/shell/make-tar.sh index 76d730d..43e5693 100644 --- a/jjb/shell/make-tar.sh +++ b/jjb/shell/make-tar.sh @@ -22,7 +22,6 @@ TARDIR=$UPLOAD_FILES_PATH set -e -u -x -o pipefail rm -fr "$TARDIR" -mkdir "$TARDIR" if [ -n "$STAGING_BUILD" ] then @@ -36,6 +35,10 @@ fi 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 ARTIFACT_NAME="onap-amsterdam-regional-controller-${STREAM}" @@ -55,7 +58,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