-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild.xml
36 lines (30 loc) · 1.35 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Spress" default="build">
<property name="dir.deploy" value="../spress.github.io" />
<property name="cmd.spress" value="../spress/bin/spress" />
<property name="cmd.git" value="git" />
<target name="build">
<exec passthru="true" checkreturn="true" command="${cmd.spress} site:build"/>
</target>
<target name="deploy" depends="build-prod, clean-dir-deploy, copy-deploy-dir, deploy-git"/>
<target name="copy-deploy-dir">
<copy todir="${dir.deploy}" >
<fileset defaultexcludes="false" expandsymboliclinks="true" dir="./build">
<include name="**" />
</fileset>
</copy>
</target>
<target name="deploy-git">
<exec passthru="true" checkreturn="true" command="${cmd.git} add -A" dir="${dir.deploy}"/>
<exec passthru="true" checkreturn="true" command="${cmd.git} commit -am'New deploy'" dir="${dir.deploy}"/>
<exec passthru="true" checkreturn="true" command="${cmd.git} push origin master" dir="${dir.deploy}"/>
</target>
<target name="build-prod">
<exec passthru="true" checkreturn="true" command="${cmd.spress} site:build --env=prod"/>
</target>
<target name="clean-dir-deploy">
<delete>
<fileset dir="${dir.deploy}"/>
</delete>
</target>
</project>