/
build.xml
193 lines (182 loc) · 6.7 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
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="dita-for-small-teams">
<property name="workspace-dir" location="${basedir}/.."/>
<property name="dist-dir" location="${basedir}/dist"/>
<property name="dist-d4st-docker-ghpages-dirname" value="d4st-docker-ghpages"/>
<property name="dist-d4st-docker-ghpages-dir" location="${workspace-dir}/${dist-d4st-docker-ghpages-dirname}"/>
<property name="dist-d4st-project-gitio-dirname" value="dita-for-small-teams.github.io"/>
<property name="dist-d4st-project-gitio-dir" location="${workspace-dir}/${dist-d4st-project-gitio-dirname}"/>
<property name="release-dir" location="${basedir}/releases"/>
<property name="d4st-dir" location="${basedir}/d4st-docker"/>
<property name="d4st-docs-dir" location="${basedir}/d4st-docker/docs"/>
<property name="d4st-project-docs-dir" location="${basedir}/documentation"/>
<property name="version" value="0-9-7"/>
<echo>workspace-dir="${workspace-dir}"</echo>
<echo>dist-d4st-project-gitio-dir="${dist-d4st-project-gitio-dir}"</echo>
<tstamp/>
<target name="dist" description="Create distribution package locally">
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${dist-dir}/d4st-docker">
<include name="**/*" />
</fileset>
</delete>
<copy todir="${dist-dir}/d4st-docker">
<fileset dir="${d4st-dir}">
<include name="d4st"/>
<include name="docker-compose*.yml"/>
<include name="README.md"/>
<include name="LICENSE"/>
<include name="containers/**/*"/>
<exclude name="containers/sandbox"/>
</fileset>
</copy>
</target>
<target name="release" depends="dist" description="Make a release Zip for the distribution">
<zip destfile="${release-dir}/d4st-docker-${version}.zip">
<zipfileset dir="${dist-dir}" >
<include name="*/**"/>
</zipfileset>
</zip>
</target>
<target name="check-d4st-docker-doc-source-changed">
<uptodate property="d4st-docker-docs-modified">
<srcfiles dir="${d4st-docs-dir}">
<include name="**/*" />
<exclude name="out/**"/>
<exclude name="temp/**"/>
</srcfiles>
<identitymapper/>
</uptodate>
<echo>d4st-docs-modified="${d4st-docker-docs-modified}"</echo>
</target>
<target name="check-d4st-project-doc-source-changed">
<uptodate property="d4st-project-doc-source-modified">
<srcfiles dir="${d4st-project-docs-dir}">
<include name="**/*" />
<exclude name="out/**"/>
<exclude name="temp/**"/>
</srcfiles>
<identitymapper/>
</uptodate>
<echo>d4st-doc-source-modified="${d4st-project-doc-source-modified}"</echo>
</target>
<target name="generate-d4st-docker-docs" depends="check-d4st-docker-doc-source-changed" if="${d4st-docker-docs-modified}"
description="Generate renditions of the DFST Docker documentation"
>
<!--
docker run -v /Users/ekimber/workspace-dfst:/opt/dita-ot/data d4st/dita-ot
ant -Dargs.input=/opt/dita-ot/data/dita-for-small-teams/d4st-docker/docs/d4st-docker-guide.ditamap
-Dtranstype=d4p-html5
-Doutput.dir=/opt/dita-ot/data/d4st-docker-ghpages
-->
<exec
searchpath="true"
executable="docker"
failonerror="true"
>
<arg value="run"/>
<arg value="-v"/>
<arg value="${workspace-dir}:/opt/dita-ot/data"/>
<arg value="dita4publishers/dita-ot:1.8.5"/>
<arg value="ant"/>
<arg value="-Dargs.input=/opt/dita-ot/data/dita-for-small-teams/d4st-docker/docs/d4st-docker-guide.ditamap"/>
<arg value="-Dtranstype=d4p-html5"/>
<arg value="-Doutput.dir=/opt/dita-ot/data/d4st-docker-ghpages"/>
</exec>
</target>
<target name="generate-d4st-project-docs" depends="check-d4st-project-doc-source-changed" if="${d4st-project-doc-source-modified}"
description="Generate renditions of the DFST project documentation"
>
<echo>Generating DFST project documentation...</echo>
<exec
searchpath="true"
executable="docker"
failonerror="true"
>
<arg value="run"/>
<arg value="-v"/>
<arg value="${workspace-dir}:/opt/dita-ot/data"/>
<arg value="d4st/dita-ot"/>
<arg value="ant"/>
<arg value="-Dargs.input=/opt/dita-ot/data/dita-for-small-teams/documentation/dita-for-small-teams.ditamap"/>
<arg value="-Dtranstype=d4p-html5"/>
<arg value="-Doutput.dir=/opt/dita-ot/data/${dist-d4st-project-gitio-dirname}"/>
</exec>
</target>
<target name="publish-d4st-docker-docs" depends="generate-d4st-docker-docs"
description="Generate the DFST Docker docs and publish to GitHub"
>
<!-- Do git commit and push of the generated docs -->
<exec searchpath="true"
executable="git"
failonerror="true"
dir="${dist-d4st-docker-ghpages-dir}"
>
<arg value="pull"/>
</exec>
<exec searchpath="true"
executable="git"
failonerror="true"
dir="${dist-d4st-docker-ghpages-dir}"
>
<arg value="add"/>
<arg value="-A"/>
</exec>
<exec searchpath="true"
executable="git"
failonerror="true"
dir="${dist-d4st-docker-ghpages-dir}"
>
<arg value="commit"/>
<arg value="-m"/>
<arg value="Documentation updated via Ant process on ${TODAY} by ${user.name}"/>
</exec>
<exec searchpath="true"
executable="git"
failonerror="true"
dir="${dist-d4st-docker-ghpages-dir}"
>
<arg value="push"/>
<arg value="origin"/>
<arg value="gh-pages"/>
</exec>
</target>
<target name="publish-d4st-project-docs" depends="generate-d4st-project-docs"
description="Generate the DFST project docs and publish to GitHub"
>
<!-- Do git commit and push of the generated docs -->
<exec searchpath="true"
executable="git"
failonerror="true"
dir="${dist-d4st-project-gitio-dir}"
>
<arg value="pull"/>
</exec>
<exec searchpath="true"
executable="git"
failonerror="true"
dir="${dist-d4st-project-gitio-dir}"
>
<arg value="add"/>
<arg value="-A"/>
</exec>
<exec searchpath="true"
executable="git"
failonerror="true"
dir="${dist-d4st-project-gitio-dir}"
>
<arg value="commit"/>
<arg value="-m"/>
<arg value="Documentation updated via Ant process on ${TODAY} by ${user.name}"/>
</exec>
<exec searchpath="true"
executable="git"
failonerror="true"
dir="${dist-d4st-project-gitio-dir}"
>
<arg value="push"/>
<arg value="origin"/>
<arg value="master"/>
</exec>
</target>
</project>