X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=ci-management.git;a=blobdiff_plain;f=jjb%2Fshell%2Fmake-tar.sh;h=2e8819af6700a059d07b6bc691cb3c8280bb77bc;hp=76d730dca4b7919b8ce3faafaca2db4c5e03d7b3;hb=0904fdd5e0e3b113ee90e77c646a7f156d878762;hpb=7af6784df0f28e49e9b7b089c7bd1f4edc324dec diff --git a/jjb/shell/make-tar.sh b/jjb/shell/make-tar.sh index 76d730d..2e8819a 100644 --- a/jjb/shell/make-tar.sh +++ b/jjb/shell/make-tar.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. # @@ -14,15 +14,17 @@ # See the License for the specific language governing permissions and # limitations under the License. +echo "---> make-tar.sh" + sudo yum install -y dos2unix # shellcheck source="$WORKSPACE/version.properties" disable=SC1091 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 @@ -33,29 +35,43 @@ else [[ ! "$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 ARTIFACT_NAME="onap-amsterdam-regional-controller-${STREAM}" TAR_NAME="${ARTIFACT_NAME}-${VERSION}.tgz" - echo "Making tar file ${TARDIR}/${TAR_NAME}" + 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}.tgz" - echo "Making tar file ${TARDIR}/${TAR_NAME}" + echo "---> Making tar file ${TARDIR}/${TAR_NAME}" cd ../onap_vm_scripts/ tar -cvzf "${TARDIR}/${TAR_NAME}" -- * else TAR_NAME="${PROJECT}-${VERSION}.tgz" - echo "Making tar file ${TARDIR}/${TAR_NAME}" - tar -cvzf "${TARDIR}/${TAR_NAME}" -- * + echo "---> Making tar file ${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 + +echo "-----> Sign all artifacts" +lftools sign sigul "${TARDIR}" + set +u +x