-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
46 lines (38 loc) · 1.85 KB
/
build.xml
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
<?xml version="1.0"?>
<project name="FrommersUnlimited Demo Site" default="integration">
<property file="local.properties" />
<property file="default.properties" />
<target name="local" description="Copy site to local web server">
<mkdir dir="${local.webroot.dir}/${local.site.dir}"/>
<copy todir="${local.webroot.dir}/${local.site.dir}">
<fileset dir="web">
<and>
<different targetdir="${local.webroot.dir}/${local.site.dir}"/>
<type type="file"/>
</and>
</fileset>
</copy>
</target>
<target name="pack-site" description="Pack the site into a deployable zip file">
<mkdir dir="dist/archives" />
<!-- Build zip -->
<zip zipfile="dist/archives/demo-site.zip" whenempty="fail">
<zipfileset dir="web" />
</zip>
</target>
<target name="integration" depends="integration-delete,integration-upload,integration-unpack" description="Deploy to integration server (only runnable on integration server)" />
<target name="integration-delete" depends="pack-site" description="Deletes whatever is on the server before uploading and exploding the zip">
<sshexec host="${int.host}"
username="${int.user}"
password="${int.pass}"
command="rm -drf ${int.path}/*"/>
</target>
<target name="integration-upload" depends="integration-delete" description="Upload files to dev/integration servers">
<scp todir="${int.user}:${int.pass}@${int.host}:${int.dir.incoming}">
<fileset file="dist/archives/demo-site.zip"/>
</scp>
</target>
<target name="integration-unpack" depends="integration-upload" description="Unpack archives">
<sshexec host="${int.host}" username="${int.user}" password="${int.pass}" command="cd ${int.dir.incoming}; unzip -o demo-site.zip -d ${int.path}" trust="true" />
</target>
</project>