forked from archimatetool/archi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdrone.sh
executable file
·32 lines (32 loc) · 1.09 KB
/
drone.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
#!/bin/bash
# usage: $0 <uploadtarget>
# e.g:
# ./drone.sh "magwas,[email protected]:/home/pfs/project/archici"
set -x
date
mvnversion=$(grep version pom.xml |head -1|sed 's/.*<version>//;s/<.*//')
branchname=$(echo $DRONE_BRANCH-$DRONE_BUILD_NUMBER | sed 'sA/A-A')
./updatever $branchname
mkdir ~/Downloads
(wget -q -O ~/Downloads/archi-extra.tar.gz.in http://magwas.rulez.org/archi-extra.tar.gz && mv ~/Downloads/archi-extra.tar.gz.in ~/Downloads/archi-extra.tar.gz)&
sudo apt-get update
sudo apt-get install libwebkitgtk-1.0-0 devscripts maven xvfb wine wkhtmltopdf
sudo Xvfb -nolock :99 -screen 0 1024x768x24+32&
export DISPLAY=:99
sleep 3s; xterm&#keep the display
mvn install
if [ $DRONE_BRANCH = "master" ]
then
DEPLOYMENT=stable
else
DEPLOYMENT=unstable
fi
dest=target/upload
kill `ps ax |grep xterm|grep -v grep|awk '{print $1}'`
ps ax |grep Xvfb|egrep -v "grep|sudo"|awk '{print $1}' |xargs sudo kill
ps afx
date
mkdir -p target/upload
mv com.archimatetool.build/target/products/com.archimatetool.editor.product/Archi-* target/upload
scp -r target/upload/* $1/$DEPLOYMENT
date