-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml.ini
58 lines (50 loc) · 3.1 KB
/
build.xml.ini
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="deploy" default="remoteexec" basedir=".">
<property name="raspberrypi" value="x.x.x.x" />
<property name="raspberryport" value="22" />
<property name="raspberryfolder" value="~" />
<property name="username" value="xx" />
<property name="password" value="xx" />
<target name="clean">
<exec executable="cmd">
<env key="JAVA_HOME" value="C:\Program Files\Java\jdk1.8.0_144" />
<arg value="/c"/>
<arg value="C:\Program Files\Apache\maven\bin\mvn.cmd"/>
<arg line="clean" />
</exec>
</target>
<target name="install" depends="clean">
<exec executable="cmd">
<env key="JAVA_HOME" value="C:\Program Files\Java\jdk1.8.0_144" />
<arg value="/c"/>
<arg value="C:\Program Files\Apache\maven\bin\mvn.cmd"/>
<arg line="install" />
</exec>
</target>
<target name="remotedebug" depends="install">
<first id="jars">
<fileset dir="target" includes="**/*jar-with-dependencies.jar" />
</first>
<pathconvert pathsep="," property="jar.path" refid="jars" />
<basename file="${jar.path}" property="jar.filename" />
<echo>"Found application ${jar.path}"</echo>
<echo>"Copying application to ${raspberrypi}:${raspberryfolder}/${jar.filename}"</echo>
<scp localfile="${jar.path}" todir="${username}:${password}@${raspberrypi}:${raspberryfolder}" port="${raspberryport}" trust="true" />
<echo>"Starting ${raspberrypi}:${raspberryfolder}/${jar.filename} in debug mode"</echo>
<sshexec host="${raspberrypi}" username="${username}" password="${password}" port="${raspberryport}" trust="true" failonerror="false" usepty="true" command="sudo pkill -f 'sudo java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=y -jar ${jar.filename}'" />
<sshexec host="${raspberrypi}" username="${username}" password="${password}" port="${raspberryport}" trust="true" failonerror="true" usepty="true" command="sudo java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=y -jar ${jar.filename}" />
</target>
<target name="remoteexec" depends="install">
<first id="jars">
<fileset dir="target" includes="**/*.jar" />
</first>
<pathconvert pathsep="," property="jar.path" refid="jars" />
<basename file="${jar.path}" property="jar.filename" />
<echo>"Found application ${jar.path}"</echo>
<echo>"Copying application to ${raspberrypi}:${raspberryfolder}/${jar.filename}"</echo>
<scp localfile="${jar.path}" todir="${username}:${password}@${raspberrypi}:${raspberryfolder}" port="${raspberryport}" trust="true" />
<echo>"Starting ${raspberrypi}:${raspberryfolder}/${jar.filename} in production mode"</echo>
<sshexec host="${raspberrypi}" username="${username}" password="${password}" port="${raspberryport}" trust="true" failonerror="false" usepty="true" command="sudo pkill -f 'sudo java -jar ${jar.filename}'" />
<sshexec host="${raspberrypi}" username="${username}" password="${password}" port="${raspberryport}" trust="true" failonerror="true" usepty="false" command="nohup sudo java -jar ${jar.filename} > raspspring.log &" />
</target>
</project>