-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
32 lines (29 loc) · 1.34 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="DoesItFit_site" default="Deploy" basedir=".">
<!-- Directories -->
<property name="deploy.dir" value="/opt/DoesItFit"/>
<!-- Server settings -->
<property name="server.host" value="katana"/>
<property name="server.user" value="root"/>
<property name="server.pwd" value="password"/>
<target name="Deploy">
<echo message="Start deploy on server" />
<sshexec command="mkdir -p ${deploy.dir}" host="${server.host}" username="${server.user}" password="${server.pwd}" trust="yes"/>
<scp todir="${server.user}:${server.pwd}@${server.host}:${deploy.dir}" trust="yes">
<fileset dir=".">
<include name="DoesItFit/*"/>
<include name="**/*.py"/>
<include name="**/*.html"/>
<include name="**/*.css"/>
<include name="**/*.png"/>
</fileset>
</scp>
<echo message="Deploy on serveur with success" />
</target>
<target name="Remove all">
<sshexec command="if [ -d ${deploy.dir} ]; then rm -rf ${deploy.dir}; fi;" host="${server.host}" username="${server.user}" password="${server.pwd}" trust="yes"/>
</target>
<target name="Reload static content" depends="Deploy">
<sshexec command="python ${deploy.dir}/manage.py collectstatic --noinput" host="${server.host}" username="${server.user}" password="${server.pwd}" trust="yes"/>
</target>
</project>