-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
109 lines (96 loc) · 4.31 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
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* getlicense.io
* Copyright (C) 2014 klicap - ingeniería del puzle
*
* klicap - ingeniería del puzle, S.L.
*
* Parque Empresarial PISA
* C/Industria 1, Edificio Metropol 1, planta 3ª, módulo 3
* 41927 Mairena del Aljarafe
* Sevilla, España
*
* C.I.F. B-91858241
* [email protected] | +34 664 00 06 29 | +34 954 89 43 22
*
* $Id: build.xml 104 2014-04-07 01:09:05Z recena $
*/
-->
<project name="getlicense-website" default="dist" basedir="./">
<property file="build.properties" />
<!-- ============================================ -->
<!-- Target: clean -->
<!-- ============================================ -->
<target name="clean">
<echo msg="Cleaning temporal files..." />
<delete>
<fileset dir="./assets">
<include name="**" />
<exclude name=".htaccess" />
</fileset>
<fileset dir="./protected/runtime">
<include name="**" />
</fileset>
</delete>
<delete file="./protected/config/main.php" />
<delete file="./index.php" />
<echo msg="Cleaning target directory..." />
<delete dir="./target" includeemptydirs="true" />
</target>
<!-- ============================================ -->
<!-- Target: prepare -->
<!-- ============================================ -->
<target name="prepare" depends="clean">
<echo msg="Processing resources..." />
<copy file="./protected/config/main.tpl.php" tofile="./protected/config/main.php">
<filterchain>
<expandproperties />
</filterchain>
</copy>
<copy file="./index.tpl.php" tofile="./index.php">
<filterchain>
<expandproperties />
</filterchain>
</copy>
<echo msg="Making directory ./target" />
<mkdir dir="./target" />
<echo msg="Making directory ./target/website (output directory)" />
<mkdir dir="./target/website-${project.version}" />
</target>
<!-- ============================================ -->
<!-- Target: build -->
<!-- ============================================ -->
<target name="build" depends="prepare">
<echo msg="Copying files to output directory..." />
<echo msg="Copying ./assets to ./target/website directory..." />
<copy todir="./target/website-${project.version}">
<fileset dir=".">
<include name="**/*" />
<exclude name="protected/config/main.tpl.php" />
<exclude name="index.tpl.php" />
<exclude name="target/**" />
<exclude name="build.xml" />
<exclude name="build.properties" />
<exclude name=".project" />
</fileset>
</copy>
</target>
<!-- ============================================ -->
<!-- (DEFAULT) Target: dist -->
<!-- ============================================ -->
<target name="dist" depends="build">
<echo msg="Creating archive..." />
<tar basedir="./target" destfile="./target/website-${project.version}.tar.gz" compression="gzip" />
<echo msg="Files copied and compressed in build directory OK!" />
</target>
<!-- ============================================ -->
<!-- Target: deploy -->
<!-- ============================================ -->
<target name="deploy" depends="dist">
<echo msg="Deploying binary distribution..." />
<scp username="deployer" pubkeyfile="/Users/recena/.ssh/id_rsa.pub" privkeyfile="/Users/recena/.ssh/id_rsa" host="getlicense.io" file="./target/website-${project.version}.tar.gz" todir="/home/klicap/getlicense" />
<ssh username="deployer" pubkeyfile="/Users/recena/.ssh/id_rsa.pub" privkeyfile="/Users/recena/.ssh/id_rsa" host="getlicense.io" display="false" command="cd /home/klicap/getlicense; tar -xvzf website-${project.version}.tar.gz; rm website-${project.version}.tar.gz; rm web;ln -s website-${project.version} web; chmod g+w website-${project.version}/protected/runtime" />
<echo msg="Deployed successfully" />
</target>
</project>