X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Frelease-job.sh;h=6a5c43c91fb86737a6f91e84ebf8b8dc13ce1ad9;hb=refs%2Fchanges%2F81%2F63681%2F4;hp=b10ffb1a8cd7968c566b77b002afd51e0999bbe6;hpb=d167a2d67729501e3b521a33b668804db377842d;p=releng%2Fglobal-jjb.git diff --git a/shell/release-job.sh b/shell/release-job.sh index b10ffb1a..6a5c43c9 100644 --- a/shell/release-job.sh +++ b/shell/release-job.sh @@ -14,7 +14,7 @@ set -eu -o pipefail echo "INFO: creating virtual environment" virtualenv -p python3 /tmp/venv PATH=/tmp/venv/bin:$PATH -pipup="python -m pip install -q --upgrade pip lftools jsonschema niet twine yq" +pipup="python -m pip install -q --upgrade pip idna==2.8 lftools jsonschema niet twine yq" echo "INFO: $pipup" $pipup # show installed versions @@ -32,10 +32,12 @@ set_variables_common(){ NEXUS_PATH="${SILO}/${JENKINS_HOSTNAME}/" # Verify if using release file or parameters if $USE_RELEASE_FILE ; then - release_files=$(git diff-tree -m --no-commit-id -r "$GIT_COMMIT" --name-only -- "releases/" ".releases/") + release_files=$(git diff-tree -m --no-commit-id -r "$GIT_COMMIT" "$GIT_COMMIT^1" \ + --name-only -- "releases/" ".releases/") if (( $(grep -c . <<<"$release_files") > 1 )); then echo "INFO: RELEASE FILES ARE AS FOLLOWS: $release_files" - echo "ERROR: Committing multiple release files in the same commit OR rename/amend of existing files is not supported." + echo "ERROR: Adding multiple release files in the same commit" + echo "ERROR: OR rename/amend/delete of existing files is not supported." exit 1 else release_file="$release_files" @@ -59,6 +61,15 @@ set_variables_common(){ PATCH_DIR=$(mktemp -d) + TAG_RELEASE="${TAG_RELEASE:-None}" + if [[ $TAG_RELEASE == "None" ]]; then + if grep -q "tag_release" $release_file ; then + TAG_RELEASE=$(yq -r .tag_release "$release_file") + else + TAG_RELEASE=true + fi + fi + # Displaying Release Information (Common variables) printf "\t%-30s\n" RELEASE_ENVIRONMENT_INFO: printf "\t%-30s %s\n" RELEASE_FILE: "$release_file" @@ -68,6 +79,7 @@ set_variables_common(){ printf "\t%-30s %s\n" SILO: "$SILO" printf "\t%-30s %s\n" PROJECT: "$PROJECT" printf "\t%-30s %s\n" PROJECT-DASHED: "${PROJECT//\//-}" + printf "\t%-30s %s\n" TAG_RELEASE: "$TAG_RELEASE" printf "\t%-30s %s\n" DISTRIBUTION_TYPE: "$DISTRIBUTION_TYPE" } @@ -259,6 +271,11 @@ verify_packagecloud_match_release(){ # sigul is only available on Centos # TODO: write tag-github-repo function tag-gerrit-repo(){ + if [[ $TAG_RELEASE == false ]]; then + echo "INFO: Skipping gerrit repo tag" + return + fi + echo "INFO: tag gerrit with $GIT_TAG" # Import public signing key gpg --import "$SIGNING_PUBKEY"