forked from apache/openwhisk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
117 lines (103 loc) · 4.3 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
110
111
112
113
114
115
116
117
<project>
<import file="config/config.xml" />
<!-- clean temporary build files created by build script -->
<target name="dust">
<exec executable="/bin/date" />
<delete dir="logs" />
<delete failonerror="false">
<fileset dir="." includes="**/*.pyc" />
<fileset dir="/tmp" includes="**/wsk*.log" />
<fileset dir="/tmp" includes="**/wsk*.tmp" />
</delete>
</target>
<!-- scan the code base, checking some conventions that are enforced -->
<target name="scanCode">
<exec executable="/bin/bash" failonerror="true">
<arg value="tools/build/scanCode.sh" />
</exec>
</target>
<!-- kill all containers, garbage collect docker images, and delete scratch directories -->
<target name="clean" depends="dust,teardown">
<exec executable="./gradlew" failonerror="true">
<arg value="clean" />
</exec>
</target>
<!-- compile and build images -->
<target name="build" depends="writePropertyFile">
<var file="whisk.properties" />
<ant target="scanCode" />
<exec executable="./gradlew" failonerror="true">
<env key="DOCKER_HOST" value="${main.docker.endpoint}" />
<arg value="distDocker" />
<arg value="-PdockerRetry" />
</exec>
<ant antfile="${openwhisk.dir}/services/nginx/build.xml" target="buildProxy" />
</target>
<!-- run unit tests-->
<target name="run" depends="writePropertyFile">
<ant antfile="tests/build.xml" target="runTests" />
</target>
<!-- deploy containers -->
<target name="deploy" depends="writePropertyFile">
<antcall target="deployDatabase" />
<ant antfile="${openwhisk.dir}/services/nginx/build.xml" target="startProxy" />
<ant antfile="services/build.xml" target="deploy" />
<ant antfile="core/build.xml" target="deploy" />
<ant antfile="tools/cli/build.xml" target="buildCLI" />
<antcall target="installCatalog" />
</target>
<!-- teardown and deploy all services -->
<target name="redeploy" depends="teardown,deploy" />
<target name="teardownLocal">
<exec executable="/bin/bash">
<arg value="tools/docker/cleanDocker.sh" />
</exec>
</target>
<!-- kill all containers, garbage collect docker images -->
<target name="teardown" depends="teardownLocal,writePropertyFile">
<var file="whisk.properties" />
<exec executable="/bin/bash">
<env key="DOCKER_PORT" value="${docker.port}" />
<arg value="tools/docker/cleanAllDockers.sh" />
<arg value="${basedir}/whisk.properties" />
</exec>
</target>
<!-- Caller must have loaded whisk.prop -->
<target name="waitComponent">
<exec executable="${python.27}" failonerror="true">
<arg value="${openwhisk.dir}/tools/health/isAlive" />
<arg value="-d" />
<arg value="${basedir}" />
<arg line="--wait 60 ${component}" />
</exec>
</target>
<!-- do any database maintenance that must happen immediately before deploying -->
<target name="deployDatabase">
<var file="whisk.properties" />
<echo message="wiping databases with prefix ${db.prefix}" />
<exec dir="${openwhisk.dir}/tools/db" executable="/bin/bash">
<env key="DB_PREFIX" value="${db.prefix}" />
<arg value="wipeTransientDBs.sh" />
</exec>
</target>
<!-- install standard built-in actions using the CLI -->
<target name="installCatalog">
<var file="whisk.properties" />
<exec dir="catalog" executable="/bin/bash" failonerror="true">
<env key="PYTHON" value="${python.27}" />
<arg value="installCatalog.sh" />
<arg value="../config/keys/auth.whisk.system" />
</exec>
</target>
<!-- fetch the docker logs from all local containers to ./logs on this host -->
<target name="copyOutLogs">
<var file="whisk.properties" />
<delete dir="logs" />
<mkdir dir="logs" />
<exec executable="/bin/bash">
<env key="WHISK_LOGS_DIR" value="${whisk.logs.dir}" />
<arg value="tools/logs/copyLogs.sh" />
<arg value="${basedir}" />
</exec>
</target>
</project>