forked from jmock-developers/jmock-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
61 lines (48 loc) · 1.2 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
#!/bin/bash
# Release tool for jMock 2
export VERSION=${1:?No version number given}
export TAG=$VERSION
# Configure ssh to use the appropriate user when logging into Codehaus
REPOSITORY=https://svn.codehaus.org/jmock
WORKING_DIR=build/release
EXPORT_SUBDIR=jmock-$VERSION
WEBSITE_SUBDIR=jmock-website
REMOTE=${REMOTE:[email protected]:/home/jmock}
DIST=${DIST:-$REMOTE/public_dist}
JAVADOC=${JAVADOC:-$REMOTE/public_javadoc}
function export_release() {
svn export $REPOSITORY/tags/$VERSION $EXPORT_SUBDIR
if [ $? -ne 0 ]; then
exit 1
fi
}
function build_release() {
CLASSPATH=lib/junit-3.8.1.jar ant -Dversion=$VERSION
if [ $? -ne 0 ]; then
exit 1
fi
}
function publish_release() {
scp build/jmock-$VERSION-*.zip $DIST
if [ $? -ne 0 ]; then
exit 1
fi
}
function publish_javadoc() {
scp -r build/jmock-$VERSION/doc/ $JAVADOC/$VERSION
}
function checkout_website() {
svn co $REPOSITORY/website $WEBSITE_SUBDIR
if [ $? -ne 0 ]; then
exit 1
fi
}
echo "Publishing release of jMock $VERSION to $DIST"
rm -rf $WORKING_DIR
mkdir -p $WORKING_DIR
cd $WORKING_DIR
export_release
cd $EXPORT_SUBDIR
build_release
publish_release
publish_javadoc