-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
64 lines (51 loc) · 2.03 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="kch" default="main" basedir=".">
<property name="BUILD_DIR" value="${basedir}/build/"/>
<!-- Файлы и папки необходимые для продкашена.
Используется tar задаче -->
<fileset id="app" dir="${basedir}">
<!-- Folders -->
<exclude name="builds/**"/>
<exclude name="src/static/**"/>
<exclude name="**/__pycache__/**"/>
<include name="src/**"/>
</fileset>
<!-- Сборка проекта на продкашн -->
<target name="main" depends="clean, admin_webpack, client_webpack, tar">
</target>
<!-- Зачищает дирикторию где собирается проект
т.к. иногда попадают уже удаленные и неиспользуемые файлы-->
<target name="clean">
<delete failonerror="true">
<fileset dir="${BUILD_DIR}" includes="**/**"/>
</delete>
</target>
<target name="admin_webpack">
<exec executable="webpack" failonerror="true">
<arg value="-p"/>
<arg value="--config"/>
<arg value="webpack.admin.config.js"/>
</exec>
</target>
<target name="client_webpack">
<exec executable="webpack" failonerror="true">
<arg value="-p"/>
<arg value="--config"/>
<arg value="webpack.client.config.js"/>
</exec>
</target>
<!--
Деплой билда на сервак.
Использует внешнюю библиотеку. В документации описано https://ant.apache.org/manual/Tasks/scp.html
-->
<target name="deploy" depends="main">
<scp file="${BUILD_DIR}/${ant.project.name}.tar.gz" trust="true" todir="[email protected]:/home/pogromist/" port="2222" keyfile="~/.ssh/kch" verbose="true"/>
</target>
<!-- Архивирует папку билда -->
<target name="tar">
<mkdir dir="${BUILD_DIR}" />
<tar destfile="${BUILD_DIR}/${ant.project.name}.tar.gz" compression="gzip">
<fileset refid="app"/>
</tar>
</target>
</project>