forked from jboulon/influent
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebdeploy.xml
More file actions
158 lines (106 loc) · 5.55 KB
/
webdeploy.xml
File metadata and controls
158 lines (106 loc) · 5.55 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<?xml version="1.0" encoding="utf-8" ?>
<project name="INFLUENT_DEPLOY" default="deploy" basedir=".">
<!-- SHUT DOWN DEMO SERVER -->
<target name="shutdown-tomcat-server">
<!-- Stop the currently running tomcat server -->
<sshexec host="${webhost}" trust="yes" username="${username}" password="${password}" command="${tomcatShutdownCommand}" failonerror="false"/>
<!-- Wait a bit for stop to take effect, subsequent steps may fail otherwise -->
<sleep seconds="60"/>
</target>
<!-- DEPLOY WAR FILES TO DEMO SERVER -->
<target name="deploy-war" depends="shutdown-tomcat-server">
<!-- COPY KIVA TO DEMO SERVER -->
<!-- Delete the old kiva WAR file -->
<sshexec host="${webhost}" trust="yes" username="${username}" password="${password}" command="rm -rf ${remoteTomcatDir}/webapps/kiva*" failonerror="false"/>
<!-- Find the local kiva WAR file -->
<first id="kivaWarFile">
<fileset dir="kiva/target">
<include name="kiva-*.war"/>
</fileset>
</first>
<!-- Copy the WAR snapshot and rename to kiva.war -->
<scp file="${toString:kivaWarFile}" remoteTofile="${username}:${password}@${webhost}:${remoteTomcatDir}/webapps/kiva.war" trust="yes"/>
<!-- COPY BITCOIN TO DEMO SERVER -->
<!-- Delete the old bicoin WAR file -->
<sshexec host="${webhost}" trust="yes" username="${username}" password="${password}" command="rm -rf ${remoteTomcatDir}/webapps/bitcoin*" failonerror="false"/>
<!-- Find the local bitcoin WAR file -->
<first id="bitcoinWarFile">
<fileset dir="bitcoin/target">
<include name="bitcoin-*.war"/>
</fileset>
</first>
<!-- Copy the WAR snapshot and rename to bitcoin.war -->
<scp file="${toString:bitcoinWarFile}" remoteTofile="${username}:${password}@${webhost}:${remoteTomcatDir}/webapps/bitcoin.war" trust="yes"/>
<!-- COPY WALKER TO DEMO SERVER -->
<!-- Delete the old walker WAR file -->
<sshexec host="${webhost}" trust="yes" username="${username}" password="${password}" command="rm -rf ${remoteTomcatDir}/webapps/walker*" failonerror="false"/>
<!-- Find the local bitcoin WAR file -->
<first id="walkerWarFile">
<fileset dir="walker/target">
<include name="walker-*.war"/>
</fileset>
</first>
<!-- Copy the WAR snapshot and rename to walker.war -->
<scp file="${toString:walkerWarFile}" remoteTofile="${username}:${password}@${webhost}:${remoteTomcatDir}/webapps/walker.war" trust="yes"/>
<!-- COPY AML TO DEMO SERVER -->
<!-- Delete the old influent(aml) WAR file -->
<sshexec host="${webhost}" trust="yes" username="${username}" password="${password}" command="rm -rf ${remoteTomcatDir}/webapps/influent*" failonerror="false"/>
<!-- Find the local aml WAR file -->
<first id="influentWarFile">
<fileset dir="influent-app/target">
<include name="influent-*.war"/>
</fileset>
</first>
<!-- Copy the WAR snapshot and rename to influent.war -->
<scp file="${toString:influentWarFile}" remoteTofile="${username}:${password}@${webhost}:${remoteTomcatDir}/webapps/influent.war" trust="yes"/>
</target>
<!-- START UP DEMO SERVER -->
<target name="startup-tomcat-server" depends="shutdown-tomcat-server">
<!-- restart the tomcat server -->
<sshexec host="${webhost}" trust="yes" username="${username}" password="${password}" command="nohup ${tomcatStartupCommand} > tomcat.out 2> tomcat.err < /dev/null &"/>
<!-- Wait a bit for startup to take effect -->
<sleep minutes="2"/>
</target>
<!-- DEPLOY ALL -->
<target name="deploy" depends="shutdown-tomcat-server,deploy-war,startup-tomcat-server"/>
<!-- CREATE KIVA DEMO -->
<target name="demo">
<!-- Delete the old demo working directory -->
<delete dir="${demo_dir}"/>
<!-- Copy the Kiva Demo skeleton -->
<copy todir="${demo_dir}">
<fileset dir="${demo_files}/KivaSampleDemo"/>
</copy>
<!-- Copy the webapps into the skeleton -->
<copy todir="${demo_dir}/apache-tomcat-${tomcat_version}/webapps/kiva">
<fileset dir="kiva/target/kiva-${version}"/>
</copy>
<copy todir="${demo_dir}/apache-tomcat-${tomcat_version}/webapps/ROOT">
<fileset dir="docs/_site"/>
</copy>
<!-- Strip out shiro from the webxml -->
<copy tofile="${demo_dir}/apache-tomcat-${tomcat_version}/webapps/kiva/WEB-INF/web.xml.noshiro" file="${demo_dir}/apache-tomcat-${tomcat_version}/webapps/kiva/WEB-INF/web.xml">
<filterchain>
<linecontains negate="true">
<contains value="Shiro"/>
</linecontains>
</filterchain>
</copy>
<!-- Replace the web.xml with the stripped version -->
<delete file="${demo_dir}/apache-tomcat-${tomcat_version}/webapps/kiva/WEB-INF/web.xml"/>
<move file="${demo_dir}/apache-tomcat-${tomcat_version}/webapps/kiva/WEB-INF/web.xml.noshiro" tofile="${demo_dir}/apache-tomcat-${tomcat_version}/webapps/kiva/WEB-INF/web.xml"/>
<!-- Change the influent URL to point locally -->
<replace file="${demo_dir}/apache-tomcat-${tomcat_version}/webapps/ROOT/index.html" token="http://influent.uncharted.software/kiva/" value="http://localhost:8080/kiva/"/>
<!-- Copy entity images -->
<copy todir="${demo_dir}/apache-tomcat-${tomcat_version}/webapps/kiva/img/entities">
<fileset dir="${demo_files}/Demo_Images"/>
</copy>
<!-- Delete the old demo releases -->
<delete file="kiva/target/KivaSampleDemo*"/>
<!-- Make zip -->
<zip destfile="kiva/target/KivaSampleDemo_v${version}.zip" basedir="${demo_dir}"/>
<!-- Make tar.gz -->
<tar destfile="kiva/target/KivaSampleDemo_v${version}.tar" basedir="${demo_dir}"/>
<gzip destfile="kiva/target/KivaSampleDemo_v${version}.tar.gz" src="kiva/target/KivaSampleDemo_v${version}.tar"/>
</target>
</project>