forked from testng-team/testng-eclipse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload-release
executable file
·54 lines (45 loc) · 1.13 KB
/
upload-release
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
UPDATE_SITE=$HOME/java/testng-eclipse-update-site/
if [ $1 == "-m" ]
then
message=$2
shift
shift
fi
if [ $# -gt 0 ]
then
number=$1
jarName=eclipse-$number
jar=$UPDATE_SITE/plugins/org.testng.eclipse_$number.jar
shift
else
echo "Specify the plug-in jar file"
fi
#number=`echo $jar | awk 'BEGIN { regex="[0-9]+.[0-9]+.[0-9]+.[0-9]"; } { if (match($0, regex)) printf("%s", substr($0, RSTART, RLENGTH))}'`
ver=/tmp/eclipse-verify
rm -rf $ver
mkdir $ver
cd $ver
jar xf $jar
#jar xf eclipse-testng.jar
for i in `find . -name \*class`
do
v=`od -h $i | head -1 | awk '{print $5}'`
if [ $v != "3100" ]
then
echo "Class $i has version $v, expected 3100"
exit -1
fi
done
echo "Class OK:"
file org/testng/eclipse/TestNGPlugin.class
cd $UPDATE_SITE
target=w/eclipse-old
dir=${target}/eclipse-$number
ssh beust.com@beust.com "(rm -rf ${target}/eclipse-$number && mkdir $dir)"
scp -r * beust.com@beust.com:$dir
ssh beust.com@beust.com "(cd w && rm -f eclipse && ln -s eclipse-old/eclipse-$number eclipse)"
if [ ! -z "$message" ]
then
echo $message >/tmp/$jarName.txt
scp /tmp/$jarName.txt beust.com@beust.com:${target}
fi