3 # Copyright (C) 2009 Google Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 # This is a test script to ease development and testing on test clusters.
21 # It should not be used to update production environments.
23 # Usage: release v2.0.5
24 # Alternative: URL=file:///my/git/repo release e5823b7e2cd8a3...
25 # It will clone the given repository from the default or passed URL,
26 # checkout the given reference (a tag or branch) and then create a
27 # release archive; you will need to copy the archive and delete the
28 # temporary directory at the end
32 : ${URL:=git://git.ganeti.org/ganeti.git}
35 if [[ -z "$TAG" ]]; then
36 echo "Usage: $0 <tree-ish>" >&2
40 echo "Using Git repository $URL"
42 TMPDIR=$(mktemp -d -t gntrelease.XXXXXXXXXX)
45 echo "Cloning the repository under $TMPDIR ..."
46 git clone -q "$URL" dist
50 # Check minimum aclocal version for releasing
51 MIN_ACLOCAL_VERSION=( 1 11 1 )
52 ACLOCAL_VERSION=$(${ACLOCAL:-aclocal} --version | head -1 | \
53 sed -e 's/^[^0-9]*\([0-9\.]*\)$/\1/')
55 ACLOCAL_VERSION_REST=$ACLOCAL_VERSION
56 for v in ${MIN_ACLOCAL_VERSION[@]}; do
57 ACLOCAL_VERSION_PART=${ACLOCAL_VERSION_REST%%.*}
58 ACLOCAL_VERSION_REST=${ACLOCAL_VERSION_REST#$ACLOCAL_VERSION_PART.}
59 if [[ $v -eq $ACLOCAL_VERSION_PART ]]; then
61 elif [[ $v -lt $ACLOCAL_VERSION_PART ]]; then
64 echo "aclocal version $ACLOCAL_VERSION is too old (< 1.11.1)"
72 VERSION=$(sed -n -e '/^PACKAGE_VERSION =/ s/^PACKAGE_VERSION = // p' Makefile)
74 make distcheck-release
75 fakeroot make dist-release
76 tar tzvf ganeti-$VERSION.tar.gz
80 md5sum ganeti-$VERSION.tar.gz
83 sha1sum ganeti-$VERSION.tar.gz
85 echo "The archive is at $PWD/ganeti-$VERSION.tar.gz"
86 echo "Please copy it and remove the temporary directory when done."