-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
47 lines (46 loc) · 2.42 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
<?xml version="1.0" encoding="UTF-8" ?>
<project name="message-bird-api-assignment" basedir="." default="build">
<target name="assign-properties">
<if>
<not>
<and>
<isset property="env.NGINX_PORT"></isset>
<isset property="env.MESSAGE_BIRD_API_KEY"></isset>
<isset property="env.REDIS_SCHEME"></isset>
<isset property="env.REDIS_HOST"></isset>
<isset property="env.REDIS_PORT"></isset>
<isset property="env.DOCKER_HOST_REDIS_PORT"></isset>
</and>
</not>
<then>
<input propertyname="env.NGINX_PORT" defaultValue="8558">NGINX Port:</input>
<input propertyname="env.MESSAGE_BIRD_API_KEY">MessageBird API Key:</input>
<input propertyname="env.REDIS_SCHEME" defaultValue="tcp">Redis Scheme:</input>
<input propertyname="env.REDIS_HOST" defaultValue="redis">Redis Host:</input>
<input propertyname="env.REDIS_PORT" defaultValue="6379">Redis Port (used from the API):</input>
<input propertyname="env.DOCKER_HOST_REDIS_PORT" defaultValue="6379">
Docker Host Redis Port (different than the above key as this is used from the docker-compose):
</input>
</then>
</if>
</target>
<target name="build" depends="assign-properties">
<copy todir="${project.basedir}" overwrite="true">
<mapper type="glob" from="*_TEMPLATE" to="*"/>
<filelist dir="${project.basedir}"
files="config/MessageBird.ini_TEMPLATE,
config/Redis.ini_TEMPLATE,
docker-compose.yml_TEMPLATE"/>
<filterchain>
<replacetokens begintoken="%%" endtoken="%%">
<token key="NGINX_PORT" value="${env.NGINX_PORT}"/>
<token key="MESSAGE_BIRD_API_KEY" value="${env.MESSAGE_BIRD_API_KEY}"/>
<token key="REDIS_SCHEME" value="${env.REDIS_SCHEME}"/>
<token key="REDIS_HOST" value="${env.REDIS_HOST}"/>
<token key="REDIS_PORT" value="${env.REDIS_PORT}"/>
<token key="DOCKER_HOST_REDIS_PORT" value="${env.DOCKER_HOST_REDIS_PORT}"/>
</replacetokens>
</filterchain>
</copy>
</target>
</project>