From 8ba1a6a00ed82ef05754b9fd541c4d9f1fc1800f Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 28 Jul 2016 16:40:16 -0400 Subject: [PATCH] use git directly instead of through zuul-cloner The node that runs tag-releases does not have zuul-cloner installed. Since there's no local git cache anyway, just use git commands directly for the release-related jobs. If we add a git cache and find a secure way to install zuul-cloner we can go back to using it. Change-Id: Iadbb8521bcf7001aabb986d6f2320931221e1039 Signed-off-by: Doug Hellmann --- jenkins/scripts/release-tools/functions | 32 ++++++++++++++----- jenkins/scripts/release-tools/release.sh | 2 +- .../release-tools/release_from_yaml.sh | 2 +- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/jenkins/scripts/release-tools/functions b/jenkins/scripts/release-tools/functions index 97e393bfbc..afa739f236 100644 --- a/jenkins/scripts/release-tools/functions +++ b/jenkins/scripts/release-tools/functions @@ -85,13 +85,29 @@ defaultbranch=$branch" function clone_repo { typeset repo="$1" typeset branch="$2" - if [ -z "$branch" ]; then - branch="master" - fi + title "Cloning $repo" - (zuul-cloner --branch "$branch" git://git.openstack.org $repo \ - && (cd $repo && git review -s && git remote -v update \ - && git fetch -v --tags)) - _retval=$? - return $_retval + + set -e + + # Create the parent directory in case it doesn't already exist. + mkdir -p $(dirname $repo) + + # Clone into openstack/foo instead of just foo. + git clone git://git.openstack.org/$repo $repo + + # Configure git-review so we can propose patches to the repo if + # needed. + (cd $repo && git review -s) + + # Make sure we have all of the existing tags so we can refer to + # them for building the release notes. + (cd $repo && git fetch -v --tags) + + # Make sure the active branch is set correctly. + if [ ! -z "$branch" ]; then + (cd $repo && git checkout $branch) + fi + + return 0 } diff --git a/jenkins/scripts/release-tools/release.sh b/jenkins/scripts/release-tools/release.sh index 1aef31e99a..312bb88431 100755 --- a/jenkins/scripts/release-tools/release.sh +++ b/jenkins/scripts/release-tools/release.sh @@ -18,7 +18,7 @@ # License for the specific language governing permissions and limitations # under the License. -set -e +set -ex TOOLSDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source $TOOLSDIR/functions diff --git a/jenkins/scripts/release-tools/release_from_yaml.sh b/jenkins/scripts/release-tools/release_from_yaml.sh index 84dac8f159..fc3869ab47 100755 --- a/jenkins/scripts/release-tools/release_from_yaml.sh +++ b/jenkins/scripts/release-tools/release_from_yaml.sh @@ -17,7 +17,7 @@ # License for the specific language governing permissions and limitations # under the License. -set -e +set -ex TOOLSDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source $TOOLSDIR/functions