-
Notifications
You must be signed in to change notification settings - Fork 9
/
create-package.sh
executable file
·52 lines (43 loc) · 1.02 KB
/
create-package.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
#!/bin/bash
function die {
echo
echo ERROR: $*
exit 1
}
if [ ! -f "src/musicbrowser.php" ]; then
die cannot find src/musicbrowser.php
fi
VERSION=`grep '^define..VERSION' src/musicbrowser.php | cut -d\' -f4`
ZIPFILE="musicbrowser-$VERSION.zip"
if [ -f $ZIPFILE ]; then
die $ZIPFILE already exists
fi
FOLDER="musicbrowser"
if [ -d $FOLDER ]; then
die the $FOLDER folder already exists
fi
phpunit test
if [ $? -ne 0 ]; then
die Did not pass unit tests
fi
mkdir $FOLDER
cp src/* $FOLDER/
rm $FOLDER/*~
zip -r $ZIPFILE $FOLDER && rm -r $FOLDER && echo && echo Created $ZIPFILE
echo
echo -n "Upload $ZIPFILE to sourceforge (y/N)? "
read i
if [ "$i" = "y" ]; then
scp $ZIPFILE [email protected]:uploads
fi
RELEASE=`echo RELEASE_$VERSION | sed 's/\./_/'`
echo
echo -n "Tag release as $RELEASE to sourceforge (y/N)? "
read i
if [ "$i" = "y" ]; then
git tag $RELEASE
git push --tags
fi
echo
echo "Last but not least, please update the web site by issuing:"
echo ssh -t mingoto,[email protected] create