Skip to content

Commit 6998505

Browse files
committed
added git info to repo.xml
1 parent 922c192 commit 6998505

8 files changed

+46
-196
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ resources/fonts
77
resources/scripts/app.all.js
88
resources/scripts/app.min.js
99
/templates
10+
expath-pkg.xml
11+
repo.xml
1012

1113
# test reports
1214
tests/reports/errorShots/*

README.md

-14
Original file line numberDiff line numberDiff line change
@@ -80,20 +80,6 @@ To create an up-to-date build package to install in eXist-db, this should do
8080
ant
8181
```
8282

83-
2. DEV environment:
84-
This will build XAR files for development servers after running npm install bower install and gulp (build).
85-
The replication triggers for the producer server are enabled in `collection.xconf` and point to the dev server's replication service IP.
86-
```shell
87-
ant xar-dev
88-
```
89-
90-
3. PROD environment:
91-
This will build XAR files for production servers after running npm install bower install and gulp (build)
92-
Same as in 2. but for PROD destination
93-
```shell
94-
ant xar-prod
95-
```
96-
9783
## How to update Node and other build & development tools
9884

9985
In order to build a xar package of the app with `ant` and to run scripts, that will build the app files like ie. minified css, js, you'll need to install `node.js`, `npm` and `gulp` in certain versions, that will be specified in this projects `package.json` and `npm-shrinkwrap.json` (for dependency locks).

build.properties.xml

-10
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,4 @@
1313
<node>
1414
<path>/usr/local/opt/node@10/bin:/usr/local/bin</path>
1515
</node>
16-
<trigger>
17-
<provider-url>
18-
<dev>failover:tcp://10.0.1.114:61616</dev>
19-
<prod>failover:tcp://10.0.1.131:61616</prod>
20-
</provider-url>
21-
<destination>
22-
<dev>dynamicTopics/hsg-replication</dev>
23-
<prod>dynamicTopics/hsg-replication</prod>
24-
</destination>
25-
</trigger>
2616
</root>

build.xml

+24-159
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project default="xar" name="hsg-shell">
2+
<project default="xar" name="hsg-shell" basedir=".">
33
<xmlproperty file="build.properties.local.xml" semanticAttributes="true" keepRoot="false"/>
44
<xmlproperty file="build.properties.xml" semanticAttributes="true" keepRoot="false"/>
55
<xmlproperty file="expath-pkg.xml"/>
66
<property name="build.dir" value="build"/>
7+
<property name="git.repo.path" value="${basedir}/.git"/>
8+
<available file="${git.repo.path}" type="dir" property="git.present"/>
9+
710
<property environment="env"/>
811
<property name="files-to-be-excluded" value="${build.dir}/**,**/*.tmpl,node_modules/**,package.json,package-lock.json,gulpfile.js,.idea/**,.* example.local.build.properties,npm-shrinkwrap.json,tests/reports/**"/>
912

@@ -32,10 +35,6 @@
3235
<delete dir="${build.dir}"/>
3336
</target>
3437

35-
<target name="prepare">
36-
<echo message="Creating build folder..."/>
37-
<mkdir dir="${build.dir}"/>
38-
</target>
3938

4039
<target name="run-npm">
4140
<echo message="Calling npm start... (Production? ${node-env-is-set-for-production})"/>
@@ -47,168 +46,35 @@
4746
<echo message="${npm.output}"/>
4847
</target>
4948

50-
<target name="copy" depends="run-npm">
51-
<echo message="Copying the files to the build folder..."/>
52-
<copy todir="${build.dir}/${app.name}-${app.version}">
53-
<fileset dir="${basedir}">
54-
<exclude name="${build.dir}/**"/>
55-
<exclude name="node_modules/**"/>
56-
<exclude name="tests/pageobjects/**"/>
57-
<exclude name="tests/reports/**"/>
58-
<exclude name="tests/specs/**"/>
59-
<exclude name="wdio*"/>
60-
</fileset>
61-
</copy>
62-
</target>
63-
64-
<target name="apply-filters-to-expath-pkg">
65-
<echo message="Apply values to expath-pkg.xml..."/>
66-
<copy todir="${build.dir}/${app.name}-${app.version}" overwrite="true" verbose="true">
67-
<fileset file="expath-pkg.xml.tmpl"/>
68-
<filterset>
69-
<filter token="name" value="${app.name}"/>
70-
<filter token="version" value="${app.version}"/>
71-
<filter token="url" value="${app.url}"/>
72-
<filter token="title" value="${app.title}"/>
73-
</filterset>
74-
<globmapper from="*.tmpl" to="*"/>
75-
</copy>
76-
</target>
77-
78-
<target name="apply-filters-to-producer-dev">
79-
<echo message="Apply DEV values to collection.xconf..."/>
80-
<copy todir="${build.dir}/${app.name}-${app.version}" overwrite="true" verbose="true">
81-
<fileset file="collection.xconf.tmpl"/>
82-
<fileset file="expath-pkg.xml.tmpl"/>
83-
<filterset>
84-
<filter token="provider-url" value="${trigger.provider-url.dev}"/>
85-
<filter token="destination" value="${trigger.destination.dev}"/>
86-
<filter token="name" value="${app.name}"/>
87-
<filter token="version" value="${app.version}"/>
88-
<filter token="url" value="${app.url}"/>
89-
<filter token="title" value="${app.title}"/>
90-
</filterset>
91-
<globmapper from="*.tmpl" to="*"/>
92-
</copy>
93-
</target>
94-
95-
<target name="apply-filters-to-producer-prod">
96-
<echo message="Apply PROD values to collection.xconf..."/>
97-
<copy todir="${build.dir}/${app.name}-${app.version}" overwrite="true" verbose="true">
98-
<fileset file="collection.xconf.tmpl"/>
99-
<fileset file="expath-pkg.xml.tmpl"/>
49+
50+
<target name="xar" depends="clean,run-npm" description="create xar file">
51+
<echo message="Creating build folder..."/>
52+
<mkdir dir="${build.dir}"/>
53+
<copy todir="${basedir}" overwrite="true" verbose="true">
54+
<fileset file="*.xml.tmpl"/>
10055
<filterset>
101-
<filter token="provider-url" value="${trigger.provider-url.prod}"/>
102-
<filter token="destination" value="${trigger.destination.prod}"/>
10356
<filter token="name" value="${app.name}"/>
10457
<filter token="version" value="${app.version}"/>
10558
<filter token="url" value="${app.url}"/>
10659
<filter token="title" value="${app.title}"/>
60+
<filter token="commit-id" value="${git.revision}"/>
61+
<filter token="commit-time" value="${git.time}"/>
10762
</filterset>
10863
<globmapper from="*.tmpl" to="*"/>
10964
</copy>
110-
</target>
111-
112-
113-
<target name="xar-dev" depends="clean,prepare" description="create xar files for DEV environment">
114-
<antcall target="copy"/>
115-
<antcall target="apply-filters-to-expath-pkg"/>
116-
<echo message="------------------------------------------------------------"/>
117-
<echo message="Creating DEV 'consumer' xar file..."/>
118-
<echo message="------------------------------------------------------------"/>
119-
120-
<zip basedir="${build.dir}/${app.name}-${app.version}" destfile="${build.dir}/${app.name}-${app.version}-consumer-dev.xar">
121-
<exclude name="${build.dir}/**"/>
122-
<exclude name="**/*.tmpl"/>
123-
<exclude name="node_modules/**"/>
124-
<exclude name="package.json"/>
125-
<exclude name="package-lock.json"/>
126-
<exclude name="bower.json"/>
127-
<exclude name=".idea/**"/>
128-
<exclude name="tests/reports/**"/>
129-
<exclude name="npm-shrinkwrap.json"/>
130-
<exclude name="build.properties.local.xml"/>
131-
<exclude name="local.node-exist.json"/>
132-
<exclude name="collection.xconf"/>
133-
<exclude name="wdio*"/>
134-
</zip>
135-
136-
<antcall target="apply-filters-to-producer-dev"/>
137-
138-
<echo message="------------------------------------------------------------"/>
139-
<echo message="Creating DEV 'producer' xar file containing triggers..."/>
140-
<echo message="------------------------------------------------------------"/>
141-
142-
<zip basedir="${build.dir}/${app.name}-${app.version}" destfile="${build.dir}/${app.name}-${app.version}-producer-dev.xar">
143-
<exclude name="**/*.tmpl"/>
144-
<exclude name="node_modules/**"/>
145-
<exclude name="package.json"/>
146-
<exclude name="package-lock.json"/>
147-
<exclude name="bower.json"/>
148-
<exclude name=".idea/**"/>
149-
<exclude name="tests/reports/**"/>
150-
<exclude name="npm-shrinkwrap.json"/>
151-
<exclude name="build.properties.local.xml"/>
152-
<exclude name="local.node-exist.json"/>
153-
<exclude name="wdio*"/>
154-
</zip>
155-
<delete dir="${build.dir}/${app.name}-${app.version}"/>
156-
</target>
157-
158-
<target name="xar-prod" depends="clean,prepare" description="create xar files for PROD environment">
159-
<antcall target="copy"/>
160-
<antcall target="apply-filters-to-expath-pkg"/>
161-
162-
<echo message="------------------------------------------------------------"/>
163-
<echo message="Creating PROD 'consumer' xar file..."/>
164-
<echo message="------------------------------------------------------------"/>
165-
166-
<zip basedir="${build.dir}/${app.name}-${app.version}" destfile="${build.dir}/${app.name}-${app.version}-consumer.xar">
167-
<exclude name="${build.dir}/**"/>
168-
<exclude name="**/*.tmpl"/>
169-
<exclude name="node_modules/**"/>
170-
<exclude name="package.json"/>
171-
<exclude name="package-lock.json"/>
172-
<exclude name="bower.json"/>
173-
<exclude name=".idea/**"/>
174-
<exclude name="tests/reports/**"/>
175-
<exclude name="npm-shrinkwrap.json"/>
176-
<exclude name="build.properties.local.xml"/>
177-
<exclude name="local.node-exist.json"/>
178-
<exclude name="collection.xconf"/>
179-
</zip>
180-
181-
<antcall target="apply-filters-to-producer-prod"/>
182-
183-
<echo message="------------------------------------------------------------"/>
184-
<echo message="Creating PROD 'producer' xar file containing triggers..."/>
185-
<echo message="------------------------------------------------------------"/>
186-
187-
<zip basedir="${build.dir}/${app.name}-${app.version}" destfile="${build.dir}/${app.name}-${app.version}-producer.xar">
188-
<exclude name="${build.dir}/**"/>
189-
<exclude name="**/*.tmpl"/>
190-
<exclude name="node_modules/**"/>
191-
<exclude name="package.json"/>
192-
<exclude name="package-lock.json"/>
193-
<exclude name="bower.json"/>
194-
<exclude name=".idea/**"/>
195-
<exclude name="tests/reports/**"/>
196-
<exclude name="npm-shrinkwrap.json"/>
197-
<exclude name="build.properties.local.xml"/>
198-
<exclude name="local.node-exist.json"/>
199-
</zip>
200-
<delete dir="${build.dir}/${app.name}-${app.version}"/>
201-
</target>
202-
203-
<target name="xar" depends="clean,prepare" description="create xar file">
204-
<antcall target="copy"/>
205-
<antcall target="apply-filters-to-expath-pkg"/>
65+
66+
20667
<echo message="------------------------------------------------------------"/>
20768
<echo message="Creating xar file..."/>
20869
<echo message="------------------------------------------------------------"/>
20970

210-
<zip basedir="${build.dir}/${app.name}-${app.version}" destfile="${build.dir}/${app.name}-${app.version}.xar">
211-
<exclude name="**/*.tmpl"/>
71+
<zip basedir="${basedir}" destfile="${build.dir}/${app.name}-${app.version}.xar">
72+
<exclude name="${build.dir}/**"/>
73+
<exclude name="*.tmpl"/>
74+
<exclude name="hsg-shell.xpr"/>
75+
<exclude name="build.properties.local.example.xml"/>
76+
<exclude name="build.properties.xml"/>
77+
<exclude name="build.xml"/>
21278
<exclude name="node_modules/**"/>
21379
<exclude name="package.json"/>
21480
<exclude name="package-lock.json"/>
@@ -217,9 +83,8 @@
21783
<exclude name="tests/reports/**"/>
21884
<exclude name="npm-shrinkwrap.json"/>
21985
<exclude name="build.properties.local.xml"/>
220-
<exclude name="local.node-exist.json"/>
221-
<exclude name="collection.xconf"/>
222-
</zip>
223-
<delete dir="${build.dir}/${app.name}-${app.version}"/>
86+
<exclude name="local.node-exist.json"/>
87+
<exclude name="wdio*"/>
88+
</zip>
22489
</target>
22590
</project>

collection.xconf

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<collection xmlns="http://exist-db.org/collection-config/1.0">
3-
</collection>
3+
<index>
4+
<fulltext default="none" attributes="false"/>
5+
</index>
6+
</collection>

collection.xconf.tmpl

-11
This file was deleted.

repo.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<meta xmlns="http://exist-db.org/xquery/repo">
2+
<meta xmlns="http://exist-db.org/xquery/repo" commit-id="${git.revision}" commit-time="${git.time}">
33
<description>history.state.gov 3.0 shell</description>
44
<author/>
55
<website/>

repo.xml.tmpl

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<meta xmlns="http://exist-db.org/xquery/repo" commit-id="@commit-id@" commit-time="@commit-time@">
3+
<description>history.state.gov 3.0 shell</description>
4+
<author/>
5+
<website/>
6+
<status>alpha</status>
7+
<license>GNU-LGPL</license>
8+
<copyright>true</copyright>
9+
<type>application</type>
10+
<target>hsg-shell</target>
11+
<prepare>pre-install.xql</prepare>
12+
<finish>post-install.xql</finish>
13+
<permissions xmlns:repo="http://exist-db.org/xquery/repo" password="" user="hsg" group="hsg"
14+
mode="rw-rw-r--"/>
15+
</meta>

0 commit comments

Comments
 (0)