release 1.89 KB
Newer Older
Iustin Pop's avatar
Iustin Pop committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
#!/bin/bash

# Copyright (C) 2009 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.

# This is a test script to ease development and testing on test clusters.
# It should not be used to update production environments.

# Usage: release v2.0.5
# Alternative: URL=file:///my/git/repo release e5823b7e2cd8a3...
# It will clone the given repository from the default or passed URL,
# checkout the given reference (a tag or branch) and then create a
# release archive; you will need to copy the archive and delete the
# temporary directory at the end

set -e

: ${URL:=git://git.ganeti.org/ganeti.git}
TAG="$1"

35 36 37 38 39 40 41 42
if [[ -z "$TAG" ]]; then
  echo "Usage: $0 <tree-ish>" >&2
  exit 1
fi

echo "Using Git repository $URL"

TMPDIR=$(mktemp -d -t gntrelease.XXXXXXXXXX)
Iustin Pop's avatar
Iustin Pop committed
43
cd $TMPDIR
44

Iustin Pop's avatar
Iustin Pop committed
45 46 47 48 49 50
echo "Cloning the repository under $TMPDIR ..."
git clone -q "$URL" dist
cd dist
git checkout $TAG
./autogen.sh
./configure
51

Iustin Pop's avatar
Iustin Pop committed
52
VERSION=$(sed -n -e '/^PACKAGE_VERSION =/ s/^PACKAGE_VERSION = // p' Makefile)
53

Iustin Pop's avatar
Iustin Pop committed
54 55 56
make distcheck
fakeroot make dist
tar tzvf ganeti-$VERSION.tar.gz
57 58 59 60 61 62

echo
echo 'MD5:'
md5sum ganeti-$VERSION.tar.gz
echo
echo 'SHA1:'
Iustin Pop's avatar
Iustin Pop committed
63
sha1sum ganeti-$VERSION.tar.gz
64
echo
Iustin Pop's avatar
Iustin Pop committed
65 66
echo "The archive is at $PWD/ganeti-$VERSION.tar.gz"
echo "Please copy it and remove the temporary directory when done."