-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphing.xml
More file actions
82 lines (73 loc) · 3.17 KB
/
phing.xml
File metadata and controls
82 lines (73 loc) · 3.17 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="docker" default="docker:init:dev" basedir=".">
<target name="docker:init:dev" description="kill dev, build dev">
<input propertyName="askDevSetup" message="Would you really like to continue? Existing container and volumes will be removed." validArgs="y,n" />
<if>
<equals arg1="${askDevSetup}" arg2="y"/>
<then>
<phingcall target="docker:env" />
<sleep seconds="5" />
<phingcall target="docker:down" />
<sleep seconds="5" />
<phingcall target="docker:up" />
<sleep seconds="5" />
<phingcall target="docker:nfs" />
</then>
<else>
<echo message="*** Aborted ***" />
</else>
</if>
</target>
<target name="docker:ps">
<exec passthru="true" command="docker ps" />
</target>
<target name="docker:up">
<exec passthru="true" command="docker-compose up -d --build" />
</target>
<target name="docker:stop">
<exec passthru="true" command="docker-compose stop" />
</target>
<target name="docker:env" hidden="true" description="create .env">
<resolvepath propertyName="workspacePath" file="./.." />
<copy file=".env.dist" tofile=".env" overwrite="true">
<filterchain>
<replacetokens begintoken="%%" endtoken="%%">
<token key="PATH_TO_WORKSPACE" value="${workspacePath}" />
</replacetokens>
</filterchain>
</copy>
</target>
<target name="docker:down" hidden="true">
<exec passthru="true" command="docker-compose down" />
</target>
<target name="docker:nfs" hidden="true" description="mac osx only!">
<condition property="isMacOsx" value="true" else="false">
<and>
<os family="mac"/>
<os family="Unix"/>
</and>
</condition>
<if>
<equals arg1="${isMacOsx}" arg2="true" />
<then>
<phingcall target="docker:down" />
<sleep seconds="5" />
<phingcall target="docker:volume:prune" />
<exec passthru="true" command="./scripts/nfs_for_native_docker.sh" />
<phingcall target="docker:up" />
</then>
</if>
</target>
<target name="docker:volume:prune">
<exec passthru="true" command="docker volume rm pws_pws-volume-data" />
<exec passthru="true" command="docker volume rm pws_pws-volume-mariadb" />
<exec passthru="true" command="docker volume rm pws_pws-volume-redis" />
<exec passthru="true" command="docker volume rm pws_pws-volume-session-share" />
<exec passthru="true" command="docker volume rm pws_pws-volume-elasticsearch" />
<exec passthru="true" command="docker volume rm pws_pws-volume-jenkins" />
<exec passthru="true" command="docker volume rm pws_pws-volume-rabbitmq" />
<sleep seconds="2" />
<echo msg="Remaining Volumes:" />
<exec passthru="true" command="docker volume ls" />
</target>
</project>