From: Jessica Wagantall Date: Mon, 20 Jul 2020 21:14:02 +0000 (+0000) Subject: Merge "lftools_activate should be deprecated" X-Git-Tag: v0.55.2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=4984d1074be3937fc17b1ab2dcbef8d5b635b565;hp=697cb58821b1738d527ff237b4c4502777908e4b;p=releng%2Fglobal-jjb.git Merge "lftools_activate should be deprecated" --- diff --git a/releasenotes/notes/maven-deploy-87ad380c53d8e2c2.yaml b/releasenotes/notes/maven-deploy-87ad380c53d8e2c2.yaml new file mode 100644 index 00000000..e6167196 --- /dev/null +++ b/releasenotes/notes/maven-deploy-87ad380c53d8e2c2.yaml @@ -0,0 +1,19 @@ +--- +fixes: + - | + Resolves the lftools_activate failure below. + + .. code-block:: bash + + ---> maven-deploy.sh + ImportError: cannot import name 'enquote_executable' + + Fix is to replace lftools_activate with lf-activate-venv + by sourcing lf-env.sh + lf-activate-venv is a more error resistant way to make sure a pip + package is installed + +deprecates: + - | + lftools_activate should no longer be used and will be removed + in a future release. diff --git a/shell/common-variables.sh b/shell/common-variables.sh index 346eb727..5092a8ea 100644 --- a/shell/common-variables.sh +++ b/shell/common-variables.sh @@ -23,6 +23,7 @@ echo "$MAVEN_OPTIONS" # Activates the lftools virtualenv lftools_activate() { + echo "WARNING: lftools_activate should no longer be used and will be removed in a future release." virtualenv --quiet "/tmp/v/lftools" set +u # Ignore unbound variables in activate # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 diff --git a/shell/maven-deploy.sh b/shell/maven-deploy.sh index 38c2f7dd..f9e28893 100644 --- a/shell/maven-deploy.sh +++ b/shell/maven-deploy.sh @@ -21,8 +21,6 @@ set -eu -o pipefail m2repo_dir="$WORKSPACE/m2repo" nexus_repo_url="$NEXUS_URL/content/repositories/$NEXUS_REPO" -lftools_activate - 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" \ @@ -41,5 +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"