-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackager.sh
executable file
·59 lines (41 loc) · 998 Bytes
/
packager.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
VERSION=$1
REPO=https://rubyweather.googlecode.com/svn
APP=rubyweather
APPVER=$APP-$VERSION
cd `dirname $0`
if [[ ! -n $1 ]]
then
echo "You must enter a version number!" >&2
exit 1
fi
echo "Packaging $APPVER..."
echo "Deleting old snapshot tag in SVN (if it already exists)"
svn delete $REPO/tags/$APPVER -m "deleting previous snapshot -- will be replaced with new snapshot" 2> /dev/null
echo "Creating snapshot tag in SVN"
svn copy -rHEAD $REPO/trunk $REPO/tags/$APPVER -m "Snapshot of $VERSION release"
cd ..
if [[ -d $APPVER ]]
then rm -rf $APPVER
fi
echo "Exporting snapshot from SVN"
svn export $REPO/tags/$APPVER
if [[ -f $APPVER.tar.bz2 ]]
then rm $APPVER.tar.bz2
fi
echo "Creating tar"
tar -cvjf $APPVER.tar.bz2 $APPVER
if [[ -f $APPVER.zip ]]
then rm $APPVER.zip
fi
echo "Creating zip"
zip -r $APPVER.zip $APPVER/*
cd $APPVER
if [[ -f $APPVER.gem ]]
then rm $APPVER.gem
fi
echo "Building gem"
gem build $APP.gemspec
mv $APPVER.gem ../.
cd ..
rm -rf $APPVER