X-Git-Url: https://gerrit.nordix.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=jjb%2Fonap%2Fuds%2Fscripts%2Farchive-repos.sh;h=b147e94d587d48dff45f169629467b81e931199a;hb=refs%2Fchanges%2F29%2F5629%2F2;hp=54527f9ff86465d8500fc2e1e3199123913a8ae3;hpb=d1f624a27b65afbabbcb482e91ea833b2e140193;p=infra%2Fcicd.git diff --git a/jjb/onap/uds/scripts/archive-repos.sh b/jjb/onap/uds/scripts/archive-repos.sh index 54527f9f..b147e94d 100644 --- a/jjb/onap/uds/scripts/archive-repos.sh +++ b/jjb/onap/uds/scripts/archive-repos.sh @@ -24,16 +24,6 @@ set -o pipefail # Make directory to hold source repository archive artifact mkdir -p $REPO_ARCHIVE_ARTIFACT_DIRECTORY -# Turn PROJECTS and PROJECT_DIRECTORIES paramter strings into arrays -# Required in order to loop through them -PROJECTS=(`echo $PROJECTS | sed 's/,/\n/g'`) -PROJECT_DIRECTORIES=(`echo $PROJECT_DIRECTORIES | sed 's/,/\n/g'`) - -# Find and store array lenth using one of the arrays -ARRAY_LENGTH=$(echo ${#PROJECTS[@]}) -# Take 1 of the array length for the loop -((ARRAY_LENGTH--)) - # Ensure at root of the $WORKSPACE cd $WORKSPACE @@ -44,10 +34,7 @@ VERSION=$(grep $GREP_PARAMS $POM_LOCATION) # Compress each source repository into an archive # Includes SHA commit ids of the projects for traceability of the artifacts # e.g. uds-1.7.0-SNAPSHOT-6d3abef-d96bad4.tar.gz -for i in $(seq 0 $ARRAY_LENGTH) -do - echo "----------------------------------------------------" - echo "INFO: Archive ${PROJECTS[$i]}" - echo "----------------------------------------------------" - tar -zcvf $REPO_ARCHIVE_ARTIFACT_DIRECTORY/$ARCHIVENAME-$VERSION-$COMMIT_IDS.tar.gz ${PROJECT_DIRECTORIES[$i]} -done +echo "----------------------------------------------------" +echo "INFO: Archive $PROJECTS" +echo "----------------------------------------------------" +tar -zcvf $REPO_ARCHIVE_ARTIFACT_DIRECTORY/$ARCHIVENAME-$VERSION-$COMMIT_IDS.tar.gz $PROJECT_DIRECTORIES