X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fautorelease%2Fgenerate-release-notes.sh;h=9aa5907328917b76a0b40f6bd15a3a6d94238fe6;hb=c66102093626187308b241f79772e4165f43fab6;hp=08773f77fdb075e3fe2b22fc79c686b8c7878aed;hpb=535445406bb4e277245003977e87d6180276aa32;p=releng%2Fbuilder.git diff --git a/jjb/autorelease/generate-release-notes.sh b/jjb/autorelease/generate-release-notes.sh index 08773f77f..9aa590732 100644 --- a/jjb/autorelease/generate-release-notes.sh +++ b/jjb/autorelease/generate-release-notes.sh @@ -1,4 +1,4 @@ -#!/bin/bash -x +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. @@ -11,7 +11,14 @@ # This script generates Service Release notes and appends them to the release # notes in the docs project and submits a patch. -RELEASE=${RELEASE:-$(echo "$GERRIT_EVENT_COMMENT_TEXT" | grep generate-release-notes | awk '{print $2}')} +set -x + +# shellcheck disable=SC1090 +. ~/lf-env.sh + +lf-activate-venv --python python3 "git-review==2.3.1" + +RELEASE=${RELEASE:-$(echo "$GERRIT_EVENT_COMMENT_TEXT" | base64 -d | grep generate-release-notes | awk '{print $2}')} if [ -z "$RELEASE" ]; then echo "ERROR: The RELEASE variable is not set." exit 1 @@ -32,7 +39,7 @@ cd "$DOCS_DIR" || exit 1 cp "$WORKSPACE/release-notes.rst" "docs/release-notes/release-notes-${RELEASE,,}.rst" git add docs/release-notes/ -GERRIT_COMMIT_MESSAGE="Update release notes" +GERRIT_COMMIT_MESSAGE="Update release notes for $RELEASE" GERRIT_TOPIC="autogenerate-release-notes" CHANGE_ID=$(ssh -p 29418 "jenkins-$SILO@git.opendaylight.org" gerrit query \ limit:1 owner:self is:open project:docs \ @@ -50,6 +57,9 @@ fi git status git remote add gerrit "ssh://jenkins-$SILO@git.opendaylight.org:29418/docs.git" +# Workaround for git-review failing to copy the commit-msg hook to submodules +git config core.hooksPath "$(git rev-parse --show-toplevel)/.git/hooks" + # Don't fail the build if this command fails because it's possible that there # is no changes since last update. -git review --yes -t "$GERRIT_TOPIC" || true +git review --yes -t "$GERRIT_TOPIC" "$GERRIT_BRANCH" || true