X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fmaven-deploy.sh;h=c30963bbe2543d13741579667965ef90ca0283c5;hb=f492626a44e6b6baf93ab9259547b9af0500e52d;hp=6d4165edf59d16d53cb088b910388b8b793a932b;hpb=cc00605631e750be1698bd247442172c483a7e9b;p=releng%2Fglobal-jjb.git diff --git a/shell/maven-deploy.sh b/shell/maven-deploy.sh index 6d4165ed..c30963bb 100644 --- a/shell/maven-deploy.sh +++ b/shell/maven-deploy.sh @@ -24,7 +24,7 @@ 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. @@ -32,11 +32,12 @@ 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 set -u # Re-enable. find "$m2repo_dir" -type d -empty -delete - +maven_metadata_validate "$m2repo_dir" lftools deploy nexus -s "$nexus_repo_url" "$m2repo_dir"