X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fmaven-stage.sh;h=a976312f36dfad2a182bcec91f33fec6fb808ddc;hb=0ff7cbacb76c80c8e2222d6d5917de5119c0d8fd;hp=d39d7732908c1c0216711e70bdd5dff8fd37222e;hpb=0b474d935c7ba6cbd70fa001fc6b9133b8999ea5;p=releng%2Fglobal-jjb.git diff --git a/shell/maven-stage.sh b/shell/maven-stage.sh index d39d7732..a976312f 100644 --- a/shell/maven-stage.sh +++ b/shell/maven-stage.sh @@ -1,5 +1,5 @@ -#!/bin/bash -# @License EPL-1.0 +#!/bin/bash -l +# SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. # @@ -8,7 +8,7 @@ # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html ############################################################################## - +echo "---> maven-stage.sh" # This script publishes artifacts to a staging repo in Nexus. # # $WORKSPACE/m2repo : Exists and used to deploy the staging repository. @@ -16,7 +16,12 @@ # $STAGING_PROFILE_ID : Provided by a job parameter. # Ensure we fail the job if any steps fail. -set -eu -o pipefail +set -xeu -o pipefail + +# shellcheck disable=SC1090 +. ~/lf-env.sh + +lf-activate-venv --python python3 lftools TMP_FILE="$(mktemp)" lftools deploy nexus-stage "$NEXUS_URL" "$STAGING_PROFILE_ID" "$WORKSPACE/m2repo" | tee "$TMP_FILE" @@ -24,7 +29,7 @@ staging_repo=$(sed -n -e 's/Staging repository \(.*\) created\./\1/p' "$TMP_FILE # Store repo info to a file in archives mkdir -p "$WORKSPACE/archives" -echo "$staging_repo" > "$WORKSPACE/archives/staging-repo.txt" +echo "$staging_repo ${NEXUS_URL}/content/repositories/$staging_repo" | tee -a "$WORKSPACE/archives/staging-repo.txt" # Cleanup -rm "$TMP_FILE" +rm -f "$TMP_FILE"