X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fmaven-deploy.sh;h=f9e288930aca65482d134cb5790338e9d89ec8c2;hb=6b4eba38370203ded897068371a4e50255ef588b;hp=ac0f7293b43c4d463efe88baeaf61d6969ca4331;hpb=719716379a17f934259baed686d411051bd5f859;p=releng%2Fglobal-jjb.git diff --git a/shell/maven-deploy.sh b/shell/maven-deploy.sh index ac0f7293..f9e28893 100644 --- a/shell/maven-deploy.sh +++ b/shell/maven-deploy.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. @@ -13,6 +13,7 @@ # Requires the existance of $WORKSPACE/m2repo and $WORKSPACE/m2repo-backup to # compare if maven metadata files have changed. Unchanged files are then # removed from $WORKSPACE/m2repo before uploading to the snapshot repo. +echo "---> maven-deploy.sh" # Ensure we fail the job if any steps fail. set -eu -o pipefail @@ -20,9 +21,7 @@ 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. +echo "-----> Remove metadata files that were not updated" set +e # Temporarily disable to run diff command. mapfile -t metadata_files <<< "$(diff -s -r "$m2repo_dir" "$WORKSPACE/m2repo-backup" \ | grep 'Files .* and .* are identical' \ @@ -40,4 +39,10 @@ set -u # Re-enable. find "$m2repo_dir" -type d -empty -delete +echo "-----> Install lftools" +# shellcheck disable=SC1090 +source ~/lf-env.sh +lf-activate-venv lftools + +echo "-----> Upload files to Nexus" lftools deploy nexus -s "$nexus_repo_url" "$m2repo_dir"