Skip to content

Commit b5ab5c2

Browse files
committed
Adding a build script for use when creating ASF releases and release candidates
1 parent 7c30fe5 commit b5ab5c2

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

tools/build/build_asf.sh

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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=~/incubator-cloudstack/
21+
outputdir=~/cs-asf-build/
22+
branch='master'
23+
while getopts v:s:o:b: opt
24+
do
25+
case "$opt" in
26+
v) version="$OPTARG";;
27+
s) sourcedir="$OPTARG";;
28+
o) outputdir="$OPTARG";;
29+
b) branch="$OPTARG";;
30+
\?) # unknown flag
31+
echo >&2 \
32+
"usage: $0 [-v version number] [-s source directory (defaults to $sourcedir)] [-o output directory (defaults to $outputdir)]"
33+
exit 1;;
34+
esac
35+
done
36+
shift `expr $OPTIND - 1`
37+
38+
echo $version
39+
echo $sourcedir
40+
echo $outputdir
41+
42+
if [ -d "$outputdir" ]; then
43+
rm $outputdir/*
44+
else
45+
mkdir $outputdir
46+
fi
47+
48+
cp $sourcedir/KEYS $outputdir/KEYS
49+
50+
cd $sourcedir
51+
git archive --format=tar.gz --prefix=$version/ $branch > $outputdir/cloudstack-source-$version.tar.gz
52+
git archive --format=zip --prefix=$version/ $branch > $outputdir/cloudstack-source-$version.zip
53+
54+
cd $outputdir
55+
gpg -v --armor --output cloudstack-source-$version.tar.gz.asc --detach-sig cloudstack-source-$version.tar.gz
56+
gpg -v --armor --output cloudstack-source-$version.zip.asc --detach-sig cloudstack-source-$version.zip
57+
gpg -v --print-md MD5 cloudstack-source-$version.tar.gz > cloudstack-source-$version.tar.gz.md5
58+
gpg -v --print-md MD5 cloudstack-source-$version.zip > cloudstack-source-$version.zip.md5
59+
gpg -v --print-md SHA512 cloudstack-source-$version.tar.gz > cloudstack-source-$version.tar.gz.sha
60+
gpg -v --print-md SHA512 cloudstack-source-$version.zip > cloudstack-source-$version.zip.sha
61+
62+
gpg -v --verify cloudstack-source-$version.tar.gz.asc cloudstack-source-$version.tar.gz
63+
gpg -v --verify cloudstack-source-$version.zip.asc cloudstack-source-$version.zip

0 commit comments

Comments
 (0)