X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fmaven-deploy.sh;h=ac0f7293b43c4d463efe88baeaf61d6969ca4331;hb=76a760c1a39a38def2b9c5642645abf5abde83f3;hp=15928eea4e06f886553a5c0641fac4c9fed9d05f;hpb=bb5e0da850b1c5ed31cf76af62d91b506c13d8dd;p=releng%2Fglobal-jjb.git diff --git a/shell/maven-deploy.sh b/shell/maven-deploy.sh index 15928eea..ac0f7293 100644 --- a/shell/maven-deploy.sh +++ b/shell/maven-deploy.sh @@ -20,9 +20,11 @@ set -eu -o pipefail m2repo_dir="$WORKSPACE/m2repo" nexus_repo_url="$NEXUS_URL/content/repositories/$NEXUS_REPO" +lftools_activate + # Remove metadata files that were not updated. set +e # Temporarily disable to run diff command. -IFS=" " read -r -a metadata_files <<< "$(diff -s -r "$m2repo_dir" "$WORKSPACE/m2repo-backup" \ +mapfile -t metadata_files <<< "$(diff -s -r "$m2repo_dir" "$WORKSPACE/m2repo-backup" \ | grep 'Files .* and .* are identical' \ | awk '{print $2}')" set -e # Re-enable. @@ -30,6 +32,7 @@ set -e # Re-enable. set +u # $metadata_files could be unbound if project is new. if [ -n "${metadata_files[*]}" ]; then for i in "${metadata_files[@]}"; do + echo "Removing unmodified file $i" rm "$i"* done fi