-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
executable file
·64 lines (52 loc) · 2.73 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Dockerlastic" default="build:dev" basedir=".">
<property name="phpContainer" value="dockerlastic_dev_php"/>
<property name="composeFiles" value="-f docker-compose.yaml"/>
<target name="build:dev" description="kill dev => build dev">
<phingcall target="docker:up-build"/>
<phingcall target="composer:install" />
<phingcall target="docker:ps"/>
<echo msg="Dev build completed. System should be healthy now!"/>
</target>
<target name="docker:kill-all">
<phingcall target="docker:down"/>
<exec passthru="true" command="docker system prune -f"/>
<exec passthru="true" command="docker rmi $(docker images -a -q)"/>
<exec passthru="true" command="docker volume prune -f"/>
</target>
<target name="docker:down">
<exec passthru="true" command="cd docker/dev && docker compose ${composeFiles} down"/>
<phingcall target="docker:ps"/>
</target>
<target name="docker:up">
<exec passthru="true" command="cd docker/dev && docker compose ${composeFiles} up -d"/>
<phingcall target="docker:ps"/>
</target>
<target name="docker:up-build" hidden="true">
<exec passthru="true" checkreturn="true" command="cd docker/dev && COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose ${composeFiles} build --no-cache"/>
<phingcall target="docker:up"/>
</target>
<target name="docker:stop">
<exec passthru="true" command="cd docker/dev && docker compose ${composeFiles} stop"/>
<phingcall target="docker:ps"/>
</target>
<target name="docker:ps">
<exec passthru="true" command="docker ps"/>
</target>
<target name="docker:push" hidden="true">
<exec checkreturn="true" passthru="true" command="docker login -u ${docker.login.user} -p ${docker.login.token}"/>
<exec passthru="true" command="docker push ${docker.login.user}/dockerlastic-php:latest"/>
</target>
<target name="composer:install">
<exec passthru="true" command="docker exec ${phpContainer} sh -c '$(which php) bin/composer.phar install --optimize-autoloader'"/>
</target>
<target name="composer:update">
<exec passthru="true" command="docker exec ${phpContainer} sh -c '$(which php) bin/composer.phar update'"/>
</target>
<target name="composer:dump-autoload" hidden="true">
<exec passthru="true" command="docker exec ${phpContainer} sh -c '$(which php) bin/composer.phar dump-autoload --optimize'"/>
</target>
<target name="test:phpstan">
<exec passthru="true" command="docker exec ${phpContainer} sh -c '$(which php) bin/composer.phar analyze'"/>
</target>
</project>