diff --git a/jenkins/jobs/release-jobs.yaml b/jenkins/jobs/release-jobs.yaml index a54a632f56..ac79841aca 100644 --- a/jenkins/jobs/release-jobs.yaml +++ b/jenkins/jobs/release-jobs.yaml @@ -41,8 +41,6 @@ set -x - SERIES="blah" - # Save the version that was just tagged by parsing # ref/tags/VALUE to get VALUE. VERSION=$(echo $ZUUL_REF | cut -f3 -d/) diff --git a/jenkins/scripts/common.sh b/jenkins/scripts/common.sh index d666b62da1..4a52145164 100644 --- a/jenkins/scripts/common.sh +++ b/jenkins/scripts/common.sh @@ -11,10 +11,16 @@ # under the License. # Setup git so that git review works -function setup_git { +function configure_git_review { git config user.name "OpenStack Proposal Bot" git config user.email "openstack-infra@lists.openstack.org" git config gitreview.username "proposal-bot" +} + +# Setup git so that git review works, including creating a branch in +# case the repo started with a detached head. +function setup_git { + configure_git_review # Initial state of repository is detached, create a branch to work # from. Otherwise git review will complain. diff --git a/jenkins/scripts/release-tools/functions b/jenkins/scripts/release-tools/functions index ace6324e46..921a6a5324 100644 --- a/jenkins/scripts/release-tools/functions +++ b/jenkins/scripts/release-tools/functions @@ -122,8 +122,16 @@ function clone_repo { $zc $branch git://git.openstack.org $repo # Configure git-review so we can propose patches to the repo if - # needed. - (cd $repo && git review -s) + # needed. Some of the release scripts are still run by hand to + # recover from failure, in which case we don't want to set the git + # review user. So try to make git review work by itself first, and + # only if that fails update the git configuration. + # + # NOTE(dhellmann): configure_git_review is in ../common.sh, which + # must be sourced by the script calling this function. + if ! (cd $repo && git review -s); then + (cd $repo && configure_git_review && git review -s) + fi # Make sure we have all of the existing tags so we can refer to # them for building the release notes. diff --git a/jenkins/scripts/release-tools/release.sh b/jenkins/scripts/release-tools/release.sh index 8800491aec..51d443eeca 100755 --- a/jenkins/scripts/release-tools/release.sh +++ b/jenkins/scripts/release-tools/release.sh @@ -22,6 +22,7 @@ set -ex TOOLSDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source $TOOLSDIR/functions +source $TOOLSDIR/../common.sh function usage { echo "Usage: release.sh [-a] repository series version diff_start SHA include_pypi first-full-release extra-metadata" diff --git a/jenkins/scripts/release-tools/update_constraints.sh b/jenkins/scripts/release-tools/update_constraints.sh index 6746510087..b417dee639 100755 --- a/jenkins/scripts/release-tools/update_constraints.sh +++ b/jenkins/scripts/release-tools/update_constraints.sh @@ -21,6 +21,7 @@ set -x TOOLSDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source $TOOLSDIR/functions +source $TOOLSDIR/../common.sh function usage { echo "Usage: update_constraints.sh version"