From: Eby, Robert (re2429) Date: Thu, 29 Nov 2018 18:59:10 +0000 (-0500) Subject: Fix path snafu for relative paths X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F28%2F328%2F1;p=ci-management.git Fix path snafu for relative paths Change-Id: Ibf957ab636e209db52da145dfb746ee2f38c055a Signed-off-by: Eby, Robert (re2429) --- 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