forked from azkaban/azkaban
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
262 lines (218 loc) · 9.68 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
<?xml version="1.0"?>
<project name="azkaban" basedir="." default="all">
<property file="build.properties" />
<property name="base.dir" value="${basedir}" />
<property name="dist.jar.dir" value="${basedir}/dist/jars" />
<property name="dist.classes.dir" value="${basedir}/dist/classes" />
<property name="dist.packages.dir" value="${basedir}/dist/packages" />
<property name="dist.web.package.dir" value="${dist.packages.dir}/azkaban-web-server" />
<property name="dist.exec.package.dir" value="${dist.packages.dir}/azkaban-exec-server" />
<property name="dist.solo.package.dir" value="${dist.packages.dir}/azkaban-solo-server" />
<property name="dist.sql.package.dir" value="${dist.packages.dir}/sql" />
<property name="conf.dir" value="${basedir}/conf" />
<property name="web.package.dir" value="${basedir}/src/package/webserver" />
<property name="exec.package.dir" value="${basedir}/src/package/execserver" />
<property name="solo.package.dir" value="${basedir}/src/package/soloserver" />
<property name="lib.dir" value="${basedir}/lib" />
<property name="bin.dir" value="${basedir}/bin" />
<property name="java.src.dir" value="${basedir}/src/java" />
<property name="web.src.dir" value="${basedir}/src/web" />
<property name="sql.src.dir" value="${basedir}/src/sql" />
<property name="azkaban.jar" value="${dist.jar.dir}/${name}-${version}.jar" />
<property environment="env" />
<path id="main.classpath">
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
<pathelement path="${dist.classes.dir}" />
</path>
<!-- set the build number based on environment variable, otherwise blank -->
<property environment="env" description="System environment variables (including those set by Hudson)" />
<target name="all" depends="clean, jars" description="Builds all jars" />
<target name="clean" description="Delete generated files.">
<echo message="Deleting generated files in dist" />
<delete dir="${dist.jar.dir}" />
<delete dir="${dist.classes.dir}" />
</target>
<target name="build" description="Compile main source tree java files">
<delete dir="${dist.classes.dir}" />
<mkdir dir="${dist.classes.dir}" />
<!-- copy non-java files to classes dir to load from classpath -->
<copy todir="${dist.classes.dir}">
<fileset dir="${java.src.dir}">
<exclude name="**/*.java" />
</fileset>
</copy>
<javac fork="true" destdir="${dist.classes.dir}"
target="1.6" debug="true" deprecation="false" failonerror="true">
<src path="${java.src.dir}" />
<classpath refid="main.classpath" />
</javac>
</target>
<target name="jars" depends="build" description="Create azkaban jar">
<mkdir dir="${dist.jar.dir}" />
<jar destfile="${azkaban.jar}">
<fileset dir="${dist.classes.dir}">
<include name="**/*.*" />
</fileset>
</jar>
</target>
<target name="create-update-script" description="Prepare the creation of the Azkaban Scripts">
<!-- Generic update table scripts -->
<concat destfile="${dist.sql.package.dir}/update-all-sql-${updateVersion}.sql" fixlastline="yes">
<fileset dir="${sql.src.dir}" >
<include name="update.*.${updateVersion}.sql"/>
</fileset>
</concat>
</target>
<target name="create-update-script-2.1" description="Prepare the creation of the Azkaban Scripts">
<!-- 2.1 added the active_sla table -->
<concat destfile="${dist.sql.package.dir}/update-all-sql-2.1.sql" fixlastline="yes">
<fileset dir="${sql.src.dir}" >
<include name="create.active_sla.sql"/>
<include name="update.*.2.1.sql"/>
</fileset>
</concat>
</target>
<target name="create-update-script-2.2" description="Prepare the creation of the Azkaban Scripts">
<!-- 2.2 added the properties table -->
<concat destfile="${dist.sql.package.dir}/update-all-sql-2.2.sql" fixlastline="yes">
<fileset dir="${sql.src.dir}" >
<include name="create.properties.sql"/>
<include name="update.*.2.2.sql"/>
</fileset>
</concat>
</target>
<target name="package-sql-scripts" description="Creates a package of sql">
<delete dir="${dist.sql.package.dir}" />
<mkdir dir="${dist.sql.package.dir}" />
<concat destfile="${dist.sql.package.dir}/create-all-sql-${version}.sql" fixlastline="yes">
<fileset dir="${sql.src.dir}" >
<exclude name="update.*.sql"/>
<exclude name="database.properties"/>
</fileset>
</concat>
<!-- Collect various update scripts. -->
<!-- Not sure how to do this better yet. -->
<antcall target="create-update-script-2.1"></antcall>
<antcall target="create-update-script-2.2"></antcall>
<!-- End script collection-->
<copy todir="${dist.sql.package.dir}" >
<fileset dir="${sql.src.dir}" />
</copy>
<echo file="${dist.sql.package.dir}/database.properties" append="true">version=${version}</echo>
<tar destfile="${dist.sql.package.dir}/${name}-sql-script-${version}.tar.gz" compression="gzip" longfile="gnu">
<tarfileset dir="${dist.sql.package.dir}" prefix="azkaban-${version}" filemode="755" />
</tar>
</target>
<target name="package-web-server" depends="jars" description="Creates a package for the webserver">
<delete dir="${dist.web.package.dir}" />
<mkdir dir="${dist.web.package.dir}" />
<mkdir dir="${dist.web.package.dir}/conf" />
<mkdir dir="${dist.web.package.dir}/bin" />
<mkdir dir="${dist.web.package.dir}/lib" />
<mkdir dir="${dist.web.package.dir}/web" />
<mkdir dir="${dist.web.package.dir}/plugins" />
<mkdir dir="${dist.web.package.dir}/extlib" />
<!-- Copy Azkaban jars and libs-->
<copy file="${azkaban.jar}" todir="${dist.web.package.dir}/lib" />
<copy todir="${dist.web.package.dir}/lib" >
<fileset dir="${lib.dir}" >
<exclude name="hadoop-core*.jar"/>
</fileset>
</copy>
<!-- Copy bin files for web server only-->
<copy todir="${dist.web.package.dir}/bin" >
<fileset dir="${web.package.dir}/bin"/>
</copy>
<!-- Copy web files -->
<copy todir="${dist.web.package.dir}/web" >
<fileset dir="${web.src.dir}" />
</copy>
<!-- Copy conf create table scripts -->
<copy todir="${dist.web.package.dir}/conf" >
<fileset dir="${web.package.dir}/conf" />
</copy>
<!-- Tarball it -->
<tar destfile="${dist.web.package.dir}/${name}-web-server-${version}.tar.gz" compression="gzip" longfile="gnu">
<tarfileset dir="${dist.web.package.dir}" prefix="azkaban-${version}" filemode="755" includes="bin/*" />
<tarfileset dir="${dist.web.package.dir}" prefix="azkaban-${version}" includes="**">
<exclude name="bin/*"/>
</tarfileset>
</tar>
</target>
<target name="package-exec-server" depends="jars" description="Creates a package for the execserver">
<delete dir="${dist.exec.package.dir}" />
<mkdir dir="${dist.exec.package.dir}" />
<mkdir dir="${dist.exec.package.dir}/conf" />
<mkdir dir="${dist.exec.package.dir}/bin" />
<mkdir dir="${dist.exec.package.dir}/lib" />
<mkdir dir="${dist.exec.package.dir}/plugins" />
<mkdir dir="${dist.exec.package.dir}/extlib" />
<!-- Copy Azkaban jars and libs-->
<copy file="${azkaban.jar}" todir="${dist.exec.package.dir}/lib" />
<copy todir="${dist.exec.package.dir}/lib" >
<fileset dir="${lib.dir}" >
<exclude name="hadoop-core*.jar"/>
</fileset>
</copy>
<!-- Copy bin files for exec server only-->
<copy todir="${dist.exec.package.dir}/bin" >
<fileset dir="${exec.package.dir}/bin"/>
</copy>
<!-- Copy conf files -->
<copy todir="${dist.exec.package.dir}/conf" >
<fileset dir="${exec.package.dir}/conf" />
</copy>
<!-- Tarball it -->
<tar destfile="${dist.exec.package.dir}/${name}-executor-server-${version}.tar.gz" compression="gzip" longfile="gnu">
<tarfileset dir="${dist.exec.package.dir}" prefix="azkaban-${version}" filemode="755" includes="bin/*" />
<tarfileset dir="${dist.exec.package.dir}" prefix="azkaban-${version}" includes="**">
<exclude name="bin/*"/>
</tarfileset>
</tar>
</target>
<target name="package-solo-server" depends="jars" description="Creates a package for the solo server">
<delete dir="${dist.solo.package.dir}" />
<mkdir dir="${dist.solo.package.dir}" />
<mkdir dir="${dist.solo.package.dir}/conf" />
<mkdir dir="${dist.solo.package.dir}/bin" />
<mkdir dir="${dist.solo.package.dir}/lib" />
<mkdir dir="${dist.solo.package.dir}/plugins" />
<mkdir dir="${dist.solo.package.dir}/extlib" />
<mkdir dir="${dist.solo.package.dir}/sql" />
<!-- Copy Azkaban jars and libs-->
<copy file="${azkaban.jar}" todir="${dist.solo.package.dir}/lib" />
<copy todir="${dist.solo.package.dir}/lib" >
<fileset dir="${lib.dir}" >
<exclude name="hadoop-core*.jar"/>
</fileset>
</copy>
<!-- Copy bin files for exec server only-->
<copy todir="${dist.solo.package.dir}/bin" >
<fileset dir="${solo.package.dir}/bin"/>
</copy>
<!-- Copy conf files -->
<copy todir="${dist.solo.package.dir}/conf" >
<fileset dir="${solo.package.dir}/conf" />
</copy>
<!-- Copy web files -->
<copy todir="${dist.solo.package.dir}/web" >
<fileset dir="${web.src.dir}" />
</copy>
<!-- Copy sql files -->
<copy todir="${dist.solo.package.dir}/sql" >
<fileset dir="${sql.src.dir}" />
</copy>
<echo file="${dist.solo.package.dir}/sql/database.properties" append="true">version=${version}</echo>
<!-- Tarball it -->
<tar destfile="${dist.solo.package.dir}/${name}-solo-server-${version}.tar.gz" compression="gzip" longfile="gnu">
<tarfileset dir="${dist.solo.package.dir}" prefix="azkaban-${version}" filemode="755" includes="bin/*" />
<tarfileset dir="${dist.solo.package.dir}" prefix="azkaban-${version}" includes="**">
<exclude name="bin/*"/>
</tarfileset>
</tar>
</target>
<target name="package-all" depends="package-exec-server, package-web-server, package-solo-server, package-sql-scripts" description="Create all packages">
</target>
</project>