-
Notifications
You must be signed in to change notification settings - Fork 392
/
dist-sh
executable file
·57 lines (51 loc) · 1.99 KB
/
dist-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
#!/bin/sh
# $Id: $
# Distribute hook script, run by make automatically
# update subtree
echo "Updating substree xs-sdk-php ..."
git subtree push --prefix=sdk/php local-sdk-php master > /dev/null 2>&1
(cd ../xs-sdk-php; git push)
# get fileinfo & version
fileinfo=
filetype=BETA
devel=`cat config.h | grep PACKAGE_VERSION | cut -d \" -f 2 | grep "dev$"`
if test -z "$devel" ; then
fileinfo=`cat VERSION.inc`
git tag $fileinfo -a -m "Release: $fileinfo"
if test $? -ne 0 ; then
exit -1
fi
(cd ../xs-sdk-php; git tag $fileinfo -a -m "Release: $fileinfo"; git push --tags)
fileinfo2=`echo $fileinfo | sed 's/[a-zA-Z]//g'`
if test "$fileinfo" = "$fileinfo2" ; then
filetype=RELEASE
fi
else
fileinfo=dev
fi
# make tar ball
echo "Creating package file: xunsearch-full-$fileinfo ..."
ln -s xunsearch-full xunsearch-full-$fileinfo
tar -cHjf xunsearch-full-$fileinfo.tar.bz2 xunsearch-full-$fileinfo
rm -f xunsearch-full-$fileinfo
# upload to web server
echo "Uploading file to web server ($filetype) ..."
if test "$fileinfo" = "dev" ; then
scp xunsearch-full-$fileinfo.tar.bz2 xunsearch:./web/download
scp xunsearch-full/packages/xunsearch-sdk-*-dev.zip xunsearch:./web/download/xunsearch-sdk-dev.zip
scp VERSION.inc xunsearch:./web/protected/data/VERSION
else
scp xunsearch-full-$fileinfo.tar.bz2 xunsearch:./web/download/xunsearch-full
if test "$filetype" = "RELEASE" ; then
ssh xunsearch ln -sf xunsearch-full/xunsearch-full-$fileinfo.tar.bz2 ./web/download/xunsearch-full-latest.tar.bz2
scp xunsearch-full/packages/xunsearch-sdk-$fileinfo.zip xunsearch:./web/download/xunsearch-sdk-latest.zip
fi
scp VERSION.inc xunsearch:./web/protected/data/$filetype
# also update dev
scp xunsearch-full-$fileinfo.tar.bz2 xunsearch:./web/download/xunsearch-full-dev.tar.bz2
scp xunsearch-full/packages/xunsearch-sdk-$fileinfo.zip xunsearch:./web/download/xunsearch-sdk-dev.zip
scp VERSION.inc xunsearch:./web/protected/data/VERSION
fi
# clean local file
rm -f xunsearch-full-$fileinfo.tar.bz2
exit 0