Fix: Use NEXUS_TARGET_BUILD in Nexus IQ CLI scanner
[releng/global-jjb.git] / shell / sigul-sign-dir.sh
index 92380cc..724f190 100644 (file)
@@ -13,14 +13,19 @@ echo "---> sigul-sign-dir.sh"
 # Ensure we fail the job if any steps fail.
 set -e -o pipefail
 
+# shellcheck disable=SC1090
+. ~/lf-env.sh
+
+lf-activate-venv --python python3 lftools
+
 OS=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
 OS_RELEASE=$(facter lsbdistrelease | tr '[:upper:]' '[:lower:]')
 if [[ "$OS_RELEASE" == "8" && "$OS" == 'centos' ]]; then
     # Get Dockerfile and the enterpoint to build the docker image.
     wget -O "${WORKSPACE}/sigul-sign.sh" "https://raw.githubusercontent.com/"\
-    "lfit/releng-global-jjb/master/shell/sigul-sign.sh"
+"lfit/releng-global-jjb/master/shell/sigul-sign.sh"
     wget -O "${WORKSPACE}/Dockerfile" "https://raw.githubusercontent.com/"\
-    "lfit/releng-global-jjb/master/docker/Dockerfile"
+"lfit/releng-global-jjb/master/docker/Dockerfile"
 
     # Setup the docker environment for jenkins user
     docker build -f ${WORKSPACE}/Dockerfile \
@@ -45,6 +50,9 @@ if [[ "$OS_RELEASE" == "8" && "$OS" == 'centos' ]]; then
         --mount type=bind,source="/w/workspace",target="/w/workspace" \
         --mount type=bind,source="/home/jenkins",target="/home/jenkins" \
         -u root:root -w $(pwd) sigul-sign
+
+    # change the .asc files owner permissions back to jenkins
+    sudo chown -R jenkins:jenkins "${SIGN_DIR}"
 else
     lftools sign sigul -m "${SIGN_MODE}" "${SIGN_DIR}"
 fi