-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
86 lines (78 loc) · 3.35 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
<?xml version="1.0"?>
<project name="Magento2" basedir=".">
<!-- makes environment variables available -->
<property environment="env"/>
<property file="build.properties"/>
<property file="build.default.properties"/>
<!-- install magento 2 inside docker -->
<target name="install-m2">
<exec executable="composer">
<arg line="--working-dir=${basedir}/www/magento/ install"/>
</exec>
<antcall target="copy-www"/>
<exec executable="docker">
<arg line="exec ${docker.container.name.web} chmod +x /var/www/magento/bin/magento"/>
</exec>
<exec executable="docker">
<arg line="exec -i ${docker.container.name.web} /var/www/magento/bin/magento setup:install
--backend-frontname='${magento.backend.frontname}'
--db-host='mysql' --db-name='${magento.db.name}'
--db-user='magento' --db-password='${magento.db.pass}'
--base-url='http://magento2.docker/'
--language='${magento.language}'
--timezone='${magento.timezone}'
--currency='${magento.currency}'
--use-secure=1
--base-url-secure='https://magento2.docker/'
--use-secure-admin=1
--admin-user='${magento.admin.user}'
--admin-password='${magento.admin.pass}'
--admin-email='${magento.admin.email}'
--admin-firstname='${magento.admin.firstname}'
--admin-lastname='${magento.admin.lastname}'
--cleanup-database
--sales-order-increment-prefix='DEV'
--use-sample-data
"/>
</exec>
<exec executable="docker">
<arg line="exec ${docker.container.name.web} /var/www/magento/bin/magento deploy:mode:set developer"/>
</exec>
</target>
<!-- Copies the whole www directory to docker container -->
<target name="copy-www">
<exec executable="docker">
<arg line="cp ${basedir}/www/magento/ ${docker.container.name.web}:/var/www/"/>
</exec>
</target>
<!-- deploy magento 2 sources into www dir -->
<target name="deploy-magento-sources">
<copy todir="${basedir}/www/magento" overwrite="true">
<fileset dir="${basedir}/sources/magento2">
<include name="**"/>
</fileset>
</copy>
</target>
<!-- deploy sample data into www dir -->
<target name="deploy-sample-data">
<copy todir="${basedir}/www/magento" overwrite="true">
<fileset dir="${basedir}/sources/sample-data">
<include name="**"/>
</fileset>
</copy>
</target>
<!-- installs magento2 sample data -->
<target name="install-sample-data">
<antcall target="deploy-sample-data"/>
<antcall target="copy-www"/>
<antcall target="m2-setup-upgrade"/>
<exec executable="docker">
<arg line="exec ${docker.container.name.web} php bin/magento setup:di:compile"/>
</exec>
</target>
<target name="m2-setup-upgrade">
<exec executable="docker">
<arg line="exec ${docker.container.name.web} php /var/www/magento/bin/magento setup:upgrade"/>
</exec>
</target>
</project>