forked from gluster/glusterfs-patch-acceptance-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·128 lines (107 loc) · 2.97 KB
/
release.sh
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/bin/bash -eux
#
# Usage steps
#
# 1. Make sure $HOME is set and you have write permissions in $HOME/work/
#
# 2. Clone glusterfs.git (from http://git.gluster.com) as $HOME/work/glusterfs.git
#
# 3. Tag the commit id from which you are about to make a release with the release
# name prefixed by a "v". If you want to make 2.0.6rc5 release from the HEAD
# of release-2.0 branch, you need to:
#
# sh$ git checkout -b release-2.0 origin/release-2.0 # only for the first time on the tree
# sh$ git tag v2.0.6rc5 # this tags the HEAD of release-2.0 branch as "v2.0.6rc5"
#
# 4. Execute glusterfs-release with the release name, WITHOUT the "v" prefix. For e.g.
#
# sh$ glusterfs-release 2.0.6rc5
#
# 5. Keep inspecting the script output watching it make the tarball, compile test it,
# upload it to qa-releases directory and send out the announcement email
#
set -xe
function init_vars()
{
REVISION="glusterfs.git";
if [ "x$RELEASE_VERSION" = "x" ]; then
echo "FATAL: Unspecified \$RELEASE_VERSION"
exit 1
fi
VERSION="$RELEASE_VERSION";
if [ "x$GERRIT_REFSPEC" = "x" ]; then
echo "FATAL: Unspecified \$GERRIT_REFSPEC"
exit 1
fi
REFSPEC="$GERRIT_REFSPEC";
if [ "x$ANNOUNCE_EMAIL" = "x" ]; then
ANNOUNCE_EMAIL="avati@redhat.com, vbellur@redhat.com";
fi
EMAIL="$ANNOUNCE_EMAIL";
#REPO=git://git.sv.gnu.org/glusterfs.git
REPO="$(pwd)";
BASEDIR="$HOME/work/releases";
INSTALLDIR="$BASEDIR/$VERSION/install";
TARBALL="glusterfs-$VERSION.tar.gz";
UFOTARBALL="gluster-swift-ufo-$VERSION.tar.gz";
SWIFT_VERSION="1.8.0"
RPMBUILD="$HOME/rpmbuild/RPMS"
PFX="pub/gluster/glusterfs";
BITS="/$PFX";
PATCHSET="";
}
function prepare_dirs()
{
rm -rf $BASEDIR;
mkdir -p $BASEDIR;
mkdir $BASEDIR/$VERSION;
mkdir $INSTALLDIR;
}
function get_src()
{
git clone $REPO $BASEDIR/$VERSION/$REVISION;
cd $BASEDIR/$VERSION/$REVISION;
git checkout $REFSPEC;
PATCHSET=$(git describe);
sed -i "s/^AC_INIT(.*)$/AC_INIT([glusterfs],[${VERSION}],[gluster-users@gluster.org])/" configure.ac
git log > ChangeLog;
}
function make_tarball()
{
cd $BASEDIR/$VERSION/$REVISION;
./autogen.sh;
#mkdir build;
#cd build;
./configure --enable-fusermount>/dev/null;
make dist >/dev/null;
cp *.tar.gz ..
}
function cp_tarball()
{
mkdir $BITS/src -p;
cp $BASEDIR/$VERSION/gluster*-$VERSION.tar.gz $BITS/src/
sha256sum $BITS/src/gluster*-$VERSION.tar.gz > $BITS/src/gluster*-$VERSION.sha256sum
}
function upload_rpms()
{
mkdir $BITS/src -p;
cp $BASEDIR/$VERSION/gluster*-$VERSION.tar.gz $BITS/src/
}
function announce_mail()
{
cat <<EOF | mail -s "glusterfs-$VERSION released" $EMAIL;
SRC: http://bits.gluster.org/$PFX/src/glusterfs-$VERSION.tar.gz
This release is made off $PATCHSET
-- Gluster Build System
EOF
}
function main()
{
init_vars;
prepare_dirs;
get_src;
make_tarball;
cp_tarball;
announce_mail;
}
main "$@"