File: release.sh

package info (click to toggle)
jmock2 2.5.1+dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,296 kB
  • sloc: java: 7,436; xml: 541; sh: 122; makefile: 24; ansic: 9
file content (61 lines) | stat: -rw-r--r-- 1,233 bytes parent folder | download | duplicates (3)
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
#!/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:-jmock@www.jmock.org:/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