X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Frelease-job.sh;h=7b22b280fe636b04f6a8229a9bce4d140e8f9b75;hb=fdcb4193a50803ac02b162e4b875f126b1fe8a37;hp=c27a87f8b9fa13e7bd9575fba118b219b3bc4e9f;hpb=3b12327f7116727b4c19a8465589869a6add032b;p=releng%2Fglobal-jjb.git diff --git a/shell/release-job.sh b/shell/release-job.sh index c27a87f8..7b22b280 100644 --- a/shell/release-job.sh +++ b/shell/release-job.sh @@ -11,25 +11,12 @@ echo "---> release-job.sh" set -eu -o pipefail -#Python bits. Remove when centos 7.7 builder is avaliable. -if [ -d "/opt/pyenv" ]; then - echo "INFO: Setting up pyenv" - export PYENV_ROOT="/opt/pyenv" - export PATH="$PYENV_ROOT/bin:$PATH" -fi -PYTHONPATH=$(pwd) -export PYTHONPATH - -latest_version=$(pyenv versions \ - | sed s,*,,g \ - | awk '/[0-9]+/{ print $1 }' \ - | sort --version-sort \ - | awk '/./{line=$0} END{print line}') - -pyenv local "$latest_version" - -export PYENV_VERSION="$latest_version" -pip install --user lftools[nexus] jsonschema niet yq +set +u +python3 -m venv /tmp/v/venv/ +# shellcheck disable=SC1091 +source /tmp/v/venv/bin/activate +set -u +python -m pip install lftools[nexus] jsonschema niet yq #Functions. @@ -91,8 +78,8 @@ set_variables_maven(){ # Continuing displaying Release Information (Maven) printf "\t%-30s\n" RELEASE_MAVEN_INFO: printf "\t%-30s %s\n" VERSION: $VERSION - printf "\t%-30s %s\n" LOG DIR: $LOG_DIR - printf "\t%-30s %s\n" LOGS URL: $LOGS_URL + printf "\t%-30s %s\n" LOG_DIR: $LOG_DIR + printf "\t%-30s %s\n" LOGS_URL: $LOGS_URL } set_variables_container(){ @@ -138,6 +125,18 @@ verify_version(){ fi } +verify_version_match_release(){ + wget -P /tmp "${LOGS_URL}/"console.log.gz + echo "INFO: Comparing version $VERSION with log snippet from maven-stage:" + if zgrep "Successfully uploaded" /tmp/console.log.gz | grep "$VERSION"; then + echo "INFO: version $VERSION matches maven-stage artifacts" + else + echo "ERROR: Defined version in release file does not match staging repo artifacts version to be released" + echo " Please make sure maven-stage job selected as candidate and release version are correct" + exit 1 + fi +} + tag(){ # Import public signing key gpg --import "$SIGNING_PUBKEY" @@ -262,6 +261,7 @@ if [[ "$DISTRIBUTION_TYPE" == "maven" ]]; then fi set_variables_maven verify_version + verify_version_match_release maven_release_file elif [[ "$DISTRIBUTION_TYPE" == "container" ]]; then wget -q https://raw.githubusercontent.com/lfit/releng-global-jjb/master/schema/release-container-schema.yaml