This repository was archived by the owner on Apr 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild.xml
More file actions
196 lines (178 loc) · 10.7 KB
/
build.xml
File metadata and controls
196 lines (178 loc) · 10.7 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<?xml version="1.0" encoding="UTF-8"?>
<project name="magja-catalog-ext" xmlns:aether="antlib:org.sonatype.aether.ant">
<taskdef uri="antlib:org.sonatype.aether.ant" resource="org/sonatype/aether/ant/antlib.xml"/>
<property file="extension.properties"/>
<property file="deploy.properties"/>
<property file="development.properties"/>
<property name="app.code.community.dir" location="app/code/community"/>
<property name="app.etc.modules.dir" location="app/etc/modules"/>
<property name="ssh.keyfile" location="${user.home}/.ssh/id_rsa"/>
<fail unless="extension.name"/>
<fail unless="extension.dirname"/>
<fail unless="extension.module1.company"/>
<fail unless="extension.module1.name"/>
<fail unless="extension.module2.company"/>
<fail unless="extension.module2.name"/>
<fail unless="extension.module3.company"/>
<fail unless="extension.module3.name"/>
<target name="remote.flush" description="Flush Magento cache storage on server.">
<fail unless="server.host"/>
<fail unless="server.port"/>
<fail unless="server.user"/>
<fail unless="server.dir"/>
<!--<sshexec host="${server.host}" username="${server.user}" port="${server.port}"
keyfile="${user.home}/.ssh/id_rsa" trust="true"
command="rm -rf ${server.dir}/var/cache/*"/>-->
<sshexec host="${server.host}" username="${server.user}" port="${server.port}"
keyfile="${ssh.keyfile}" trust="true"
command="cd '${server.dir}' && wiz cache-clear"/>
</target>
<target name="remote.compile" description="Recompile Magento includes on server.">
<fail unless="server.host"/>
<fail unless="server.port"/>
<fail unless="server.user"/>
<fail unless="server.dir"/>
<sshexec host="${server.host}" username="${server.user}" port="${server.port}"
keyfile="${ssh.keyfile}" trust="true"
command="php '${server.dir}/shell/compiler.php' compile"/>
</target>
<target name="deploy.only">
<fail unless="server.user"/>
<fail unless="server.host"/>
<fail unless="server.port"/>
<fail unless="server.dir"/>
<sshexec host="${server.host}" username="${server.user}" port="${server.port}"
keyfile="${ssh.keyfile}" trust="true"
command="mkdir -vp '${server.dir}/app/code/community/${extension.module1.company}'"/>
<sshexec host="${server.host}" username="${server.user}" port="${server.port}"
keyfile="${ssh.keyfile}" trust="true"
command="mkdir -vp '${server.dir}/app/code/community/${extension.module2.company}'"/>
<sshexec host="${server.host}" username="${server.user}" port="${server.port}"
keyfile="${ssh.keyfile}" trust="true"
command="mkdir -vp '${server.dir}/app/code/community/${extension.module3.company}'"/>
<exec executable="rsync">
<arg value="-e"/>
<arg value="ssh -p${server.port}"/>
<arg value="-vza"/>
<arg value="--delete"/>
<arg value="${app.code.community.dir}/${extension.module1.company}/${extension.module1.name}"/>
<arg value="${server.user}@${server.host}:${server.dir}/app/code/community/${extension.module1.company}" />
</exec>
<exec executable="rsync">
<arg value="-e"/>
<arg value="ssh -p${server.port}"/>
<arg value="-vza"/>
<arg value="--delete"/>
<arg value="${app.code.community.dir}/${extension.module2.company}/${extension.module2.name}"/>
<arg value="${server.user}@${server.host}:${server.dir}/app/code/community/${extension.module2.company}" />
</exec>
<exec executable="rsync">
<arg value="-e"/>
<arg value="ssh -p${server.port}"/>
<arg value="-vza"/>
<arg value="--delete"/>
<arg value="${app.code.community.dir}/${extension.module3.company}/${extension.module3.name}"/>
<arg value="${server.user}@${server.host}:${server.dir}/app/code/community/${extension.module3.company}" />
</exec>
<exec executable="rsync">
<arg value="-e"/>
<arg value="ssh -p${server.port}"/>
<arg value="-vza"/>
<arg value="${app.etc.modules.dir}/${extension.module1.company}_${extension.module1.name}.xml"/>
<arg value="${app.etc.modules.dir}/${extension.module2.company}_${extension.module2.name}.xml"/>
<arg value="${app.etc.modules.dir}/${extension.module3.company}_${extension.module3.name}.xml"/>
<arg value="${server.user}@${server.host}:${server.dir}/app/etc/modules" />
</exec>
</target>
<target name="deploy"
description="Deploy ${extension.name} files to ${server.user}@${server.host}:${server.dir} at port ${server.port}. Then recompile and flush.">
<antcall target="deploy.only" />
<antcall target="remote.compile" />
<antcall target="remote.flush" />
</target>
<target name="undeploy" description="Delete deployed files for ${extension.name} theme in ${server.host}:${server.dir}.">
<fail unless="server.user"/>
<fail unless="server.host"/>
<fail unless="server.port"/>
<fail unless="server.dir"/>
<sshexec host="${server.host}" username="${server.user}" port="${server.port}"
keyfile="${ssh.keyfile}" trust="true"
command="rm -rvf '${server.dir}/app/code/community/${extension.module1.company}/${extension.module1.name}' '${server.dir}/app/etc/modules/${extension.module1.company}_${extension.module1.name}.xml'"/>
<sshexec host="${server.host}" username="${server.user}" port="${server.port}"
keyfile="${ssh.keyfile}" trust="true"
command="rm -rvf '${server.dir}/app/code/community/${extension.module2.company}/${extension.module2.name}' '${server.dir}/app/etc/modules/${extension.module2.company}_${extension.module2.name}.xml'"/>
<sshexec host="${server.host}" username="${server.user}" port="${server.port}"
keyfile="${ssh.keyfile}" trust="true"
command="rm -rvf '${server.dir}/app/code/community/${extension.module3.company}/${extension.module3.name}' '${server.dir}/app/etc/modules/${extension.module3.company}_${extension.module3.name}.xml'"/>
<antcall target="remote.flush"/>
<antcall target="remote.compile"/>
</target>
<target name="symlink.create" description="Create symlinks to ${extension.name} theme in ${magento.dir}. It will not overwrite existing files/links.">
<fail unless="magento.dir" message="Please set 'magento.dir' property to your Magento installation folder."/>
<mkdir dir="${magento.dir}/app/code/community/${extension.module1.company}"/>
<mkdir dir="${magento.dir}/app/code/community/${extension.module2.company}"/>
<mkdir dir="${magento.dir}/app/code/community/${extension.module3.company}"/>
<symlink link="${magento.dir}/app/code/community/${extension.module1.company}/" resource="${app.code.community.dir}/${extension.module1.company}/${extension.module1.name}" failonerror="false"/>
<symlink link="${magento.dir}/app/code/community/${extension.module2.company}/" resource="${app.code.community.dir}/${extension.module2.company}/${extension.module2.name}" failonerror="false"/>
<symlink link="${magento.dir}/app/code/community/${extension.module3.company}/" resource="${app.code.community.dir}/${extension.module3.company}/${extension.module3.name}" failonerror="false"/>
<copy file="${app.etc.modules.dir}/${extension.module1.company}_${extension.module1.name}.xml" todir="${magento.dir}/app/etc/modules/" verbose="true"/>
<copy file="${app.etc.modules.dir}/${extension.module2.company}_${extension.module2.name}.xml" todir="${magento.dir}/app/etc/modules/" verbose="true"/>
<copy file="${app.etc.modules.dir}/${extension.module3.company}_${extension.module3.name}.xml" todir="${magento.dir}/app/etc/modules/" verbose="true"/>
</target>
<target name="symlink.delete" description="Delete symlinks to ${extension.name} theme in ${magento.dir}. It will only delete files or symlinks, not directories.">
<fail unless="magento.dir" message="Please set 'magento.dir' property to your Magento installation folder."/>
<symlink action="delete" link="${magento.dir}/app/code/community/${extension.module1.company}/${extension.module1.name}" failonerror="false"/>
<symlink action="delete" link="${magento.dir}/app/code/community/${extension.module2.company}/${extension.module2.name}" failonerror="false"/>
<symlink action="delete" link="${magento.dir}/app/code/community/${extension.module3.company}/${extension.module3.name}" failonerror="false"/>
<delete file="${magento.dir}/app/etc/modules/${extension.module1.company}_${extension.module1.name}.xml" />
<delete file="${magento.dir}/app/etc/modules/${extension.module2.company}_${extension.module2.name}.xml" />
<delete file="${magento.dir}/app/etc/modules/${extension.module3.company}_${extension.module3.name}.xml" />
</target>
<target name="package" description="Package into tar.bz2">
<tar destfile="target/${extension.name}.tar.bz2"
compression="bzip2" basedir=".">
<include name="${extension.module.company}_${extension.module.name}.xml"/>
<include name="build.xml"/>
<include name="maven-pom.xml"/>
<include name="*.sample"/>
<include name="extension.properties"/>
<include name="README.*"/>
<include name="app/**"/>
</tar>
</target>
<aether:pom id="main-pom" file="maven-pom.xml"/>
<aether:artifacts id="main-artifacts">
<aether:artifact file="target/${extension.name}.tar.bz2" type="tar.bz2"/>
</aether:artifacts>
<aether:remoterepo id="bippo-private-releases" url="http://nexus.bippo.co.id/nexus/content/repositories/bippo-private-releases/"/>
<aether:remoterepo id="bippo-private-snapshots" url="http://nexus.bippo.co.id/nexus/content/repositories/bippo-private-snapshots/"/>
<aether:remoterepo id="annafi-releases" url="http://localhost:8080/nexus/content/repositories/releases/"/>
<aether:remoterepo id="annafi-snapshots" url="http://localhost:8080/nexus/content/repositories/snapshots/"/>
<aether:remoterepo id="bippo-gk-releases" url="http://192.168.66.17:8080/nexus/content/repositories/releases/"/>
<aether:remoterepo id="bippo-gk-snapshots" url="http://192.168.66.17:8080/nexus/content/repositories/snapshots/"/>
<target name="install" description="Install to local Maven repository"
depends="package">
<aether:install artifactsref="main-artifacts" pomref="main-pom"/>
</target>
<target name="repo.deploy" description="Deploy to nexus.bippo.co.id repository"
depends="package">
<aether:deploy artifactsref="main-artifacts" pomref="main-pom">
<remoterepo refid="bippo-private-releases"/>
<snapshotrepo refid="bippo-private-snapshots"/>
</aether:deploy>
</target>
<target name="repo.deploy.local" description="Deploy to local Nexus repository"
depends="package">
<aether:deploy artifactsref="main-artifacts" pomref="main-pom">
<remoterepo refid="annafi-releases"/>
<snapshotrepo refid="annafi-snapshots"/>
</aether:deploy>
</target>
<target name="repo.deploy.bippo.gk" description="Deploy to Bippo GK Nexus repository"
depends="package">
<aether:deploy artifactsref="main-artifacts" pomref="main-pom">
<remoterepo refid="bippo-gk-releases"/>
<snapshotrepo refid="bippo-gk-snapshots"/>
</aether:deploy>
</target>
</project>