Skip to content

Commit c064afe

Browse files
author
Chip Childers
committed
Adding new release manager scripts to master (used for 4.1.0 RCs)
Signed-off-by: Chip Childers <chipchilders@apache.org>
1 parent a1912d9 commit c064afe

2 files changed

Lines changed: 141 additions & 13 deletions

File tree

tools/build/build_asf.sh

Lines changed: 66 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,34 @@
1818

1919
version='TESTBUILD'
2020
sourcedir=~/cloudstack/
21-
outputdir=~/cs-asf-build/
21+
outputdir=/tmp/cloudstack-build/
2222
branch='master'
2323
tag='no'
2424
certid='X'
25+
committosvn='X'
2526

2627
usage(){
27-
echo "usage: $0 -v version [-b branch] [-s source dir] [-o output dir] [-t [-u]] [-h]"
28+
echo "usage: $0 -v version [-b branch] [-s source dir] [-o output dir] [-t] [-u] [-c] [-h]"
2829
echo " -v sets the version"
2930
echo " -b sets the branch (defaults to 'master')"
3031
echo " -s sets the source directory (defaults to $sourcedir)"
3132
echo " -o sets the output directory (defaults to $outputdir)"
3233
echo " -t tags the git repo with the version"
33-
echo " -u sets the certificate ID to sign the tag with (if not provided, the default key is attempted)"
34-
echo " -k sets the key to sign the tarball with"
34+
echo " -u sets the certificate ID to sign with (if not provided, the default key is attempted)"
35+
echo " -c commits build artifacts to cloudstack dev dist dir in svn"
3536
echo " -h"
3637
}
3738

38-
while getopts v:s:o:b:tu:k:h opt
39+
while getopts v:s:o:b:u:tch opt
3940
do
4041
case "$opt" in
4142
v) version="$OPTARG";;
4243
s) sourcedir="$OPTARG";;
4344
o) outputdir="$OPTARG";;
4445
b) branch="$OPTARG";;
45-
t) tag='yes';;
46+
t) tag="yes";;
4647
u) certid="$OPTARG";;
47-
k) keyid="--default-key $OPTARG";;
48+
c) committosvn="yes";;
4849
h) usage
4950
exit 0;;
5051
/?) # unknown flag
@@ -54,7 +55,7 @@ do
5455
done
5556
shift `expr $OPTIND - 1`
5657

57-
if [ $version == 'TESTBUILD' ]; then
58+
if [ $version == "TESTBUILD" ]; then
5859
echo >&2 "A version must be specified with the -v option: build_asf.sh -v 4.0.0.RC1"
5960
exit 1
6061
fi
@@ -63,8 +64,8 @@ echo "Using version: $version"
6364
echo "Using source directory: $sourcedir"
6465
echo "Using output directory: $outputdir"
6566
echo "Using branch: $branch"
66-
if [ $tag == 'yes' ]; then
67-
if [ $certid == 'X' ]; then
67+
if [ "$tag" == "yes" ]; then
68+
if [ "$certid" == "X" ]; then
6869
echo "Tagging the branch with the version number, and signing the branch with your default certificate."
6970
else
7071
echo "Tagging the branch with the version number, and signing the branch with certificate ID $certid."
@@ -80,13 +81,38 @@ else
8081
fi
8182

8283
cd $sourcedir
84+
85+
echo 'checking out correct branch'
86+
git checkout $branch
87+
88+
echo 'determining current mvn version'
89+
export currentversion=`mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\['`
90+
echo "found $currentversion"
91+
92+
echo 'setting version numbers'
93+
mvn versions:set -DnewVersion=$version -P vmware -P developer -P systemvm -P simulator -P baremetal -P ucs -Dnonoss
94+
mv deps/XenServerJava/pom.xml.versionsBackup deps/XenServerJava/pom.xml
95+
perl -pi -e 's/$ENV{'currentversion'}/$ENV{'version'}/' deps/XenServerJava/pom.xml
96+
perl -pi -e 's/$ENV{'currentversion'}/$ENV{'version'}/' tools/apidoc/pom.xml
97+
git clean -f
98+
99+
echo 'commit changes'
100+
git commit -a -s -m "Updating pom.xml version numbers for release $version"
101+
export commitsh=`git show HEAD | head -n 1 | cut -d ' ' -f 2`
102+
103+
echo "committed as $commitsh"
104+
83105
echo 'archiving'
84106
git archive --format=tar --prefix=apache-cloudstack-$version-src/ $branch > $outputdir/apache-cloudstack-$version-src.tar
85107
bzip2 $outputdir/apache-cloudstack-$version-src.tar
86108

87109
cd $outputdir
88110
echo 'armor'
89-
gpg -v $keyid --armor --output apache-cloudstack-$version-src.tar.bz2.asc --detach-sig apache-cloudstack-$version-src.tar.bz2
111+
if [ "$certid" == "X" ]; then
112+
gpg -v --armor --output apache-cloudstack-$version-src.tar.bz2.asc --detach-sig apache-cloudstack-$version-src.tar.bz2
113+
else
114+
gpg -v --default-key $certid --armor --output apache-cloudstack-$version-src.tar.bz2.asc --detach-sig apache-cloudstack-$version-src.tar.bz2
115+
fi
90116

91117
echo 'md5'
92118
gpg -v --print-md MD5 apache-cloudstack-$version-src.tar.bz2 > apache-cloudstack-$version-src.tar.bz2.md5
@@ -97,12 +123,39 @@ gpg -v --print-md SHA512 apache-cloudstack-$version-src.tar.bz2 > apache-cloudst
97123
echo 'verify'
98124
gpg -v --verify apache-cloudstack-$version-src.tar.bz2.asc apache-cloudstack-$version-src.tar.bz2
99125

100-
if [ $tag == 'yes' ]; then
126+
if [ "$tag" == "yes" ]; then
101127
echo 'tag'
102128
cd $sourcedir
103-
if [ $certid == 'X' ]; then
129+
if [ "$certid" == "X" ]; then
104130
git tag -s $version -m "Tagging release $version on branch $branch."
105131
else
106132
git tag -u $certid -s $version -m "Tagging release $version on branch $branch."
107133
fi
108134
fi
135+
136+
if [ "$committosvn" == "yes" ]; then
137+
echo 'committing artifacts to svn'
138+
rm -Rf /tmp/cloudstack-dev-dist
139+
cd /tmp
140+
svn co https://dist.apache.org/repos/dist/dev/cloudstack/ cloudstack-dev-dist
141+
cd cloudstack-dev-dist
142+
if [ -d "$version" ]; then
143+
cd $version
144+
svn rm *
145+
else
146+
mkdir $version
147+
svn add $version
148+
cd $version
149+
fi
150+
cp $outputdir/apache-cloudstack-$version-src.tar.bz2 .
151+
cp $outputdir/apache-cloudstack-$version-src.tar.bz2.asc .
152+
cp $outputdir/apache-cloudstack-$version-src.tar.bz2.md5 .
153+
cp $outputdir/apache-cloudstack-$version-src.tar.bz2.sha .
154+
svn add apache-cloudstack-$version-src.tar.bz2
155+
svn add apache-cloudstack-$version-src.tar.bz2.asc
156+
svn add apache-cloudstack-$version-src.tar.bz2.md5
157+
svn add apache-cloudstack-$version-src.tar.bz2.sha
158+
svn commit -m "Committing release candidate artifacts for $version to dist/dev/cloudstack in preparation for release vote"
159+
fi
160+
161+
echo "completed. use commit-sh of $commitsh when starting the VOTE thread"

tools/build/setnextversion.sh

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/bin/sh
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
19+
version='TESTBUILD'
20+
sourcedir=~/cloudstack/
21+
branch='master'
22+
23+
usage(){
24+
echo "usage: $0 -v version [-b branch] [-s source dir] [-h]"
25+
echo " -v sets the version"
26+
echo " -b sets the branch (defaults to 'master')"
27+
echo " -s sets the source directory (defaults to $sourcedir)"
28+
echo " -h"
29+
}
30+
31+
while getopts v:s:b:h opt
32+
do
33+
case "$opt" in
34+
v) version="$OPTARG";;
35+
s) sourcedir="$OPTARG";;
36+
b) branch="$OPTARG";;
37+
h) usage
38+
exit 0;;
39+
/?) # unknown flag
40+
usage
41+
exit 1;;
42+
esac
43+
done
44+
shift `expr $OPTIND - 1`
45+
46+
if [ $version == 'TESTBUILD' ]; then
47+
echo >&2 "A version must be specified with the -v option: $0 -v 4.0.0.RC1"
48+
exit 1
49+
fi
50+
51+
echo "Using version: $version"
52+
echo "Using source directory: $sourcedir"
53+
echo "Using branch: $branch"
54+
55+
cd $sourcedir
56+
57+
echo 'checking out correct branch'
58+
git checkout $branch
59+
60+
echo 'determining current mvn version'
61+
export currentversion=`mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\['`
62+
echo "found $currentversion"
63+
64+
echo 'setting version numbers'
65+
mvn versions:set -DnewVersion=$version -P vmware -P developer -P systemvm -P simulator -P baremetal -P ucs -Dnonoss
66+
mv deps/XenServerJava/pom.xml.versionsBackup deps/XenServerJava/pom.xml
67+
perl -pi -e 's/$ENV{'currentversion'}/$ENV{'version'}/' deps/XenServerJava/pom.xml
68+
perl -pi -e 's/$ENV{'currentversion'}/$ENV{'version'}/' tools/apidoc/pom.xml
69+
git clean -f
70+
71+
echo 'commit changes'
72+
git commit -a -s -m "Updating pom.xml version numbers for release $version"
73+
export commitsh=`git show HEAD | head -n 1 | cut -d ' ' -f 2`
74+
75+
echo "committed as $commitsh"

0 commit comments

Comments
 (0)