This repository has been archived by the owner on Nov 16, 2022. It is now read-only.
forked from bippo/customshippingrate-magento
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
112 lines (99 loc) · 5.81 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
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="customshippingrate">
<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.design.dir" location="app/design"/>
<property name="app.etc.modules.dir" location="app/etc/modules"/>
<property name="locale.dir" location="app/locale"/>
<fail unless="extension.name"/>
<fail unless="extension.dirname"/>
<fail unless="extension.module.company"/>
<fail unless="extension.module.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="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="${user.home}/.ssh/id_rsa" trust="true"
command="php '${server.dir}/shell/compiler.php' compile"/>
</target>
<target name="deploy"
description="Deploy ${extension.name} files to ${server.user}@${server.host}:${server.dir} at port ${server.port}. Then recompile and flush.">
<fail unless="server.user"/>
<fail unless="server.host"/>
<fail unless="server.port"/>
<fail unless="server.dir"/>
<exec executable="ssh">
<arg value="-p"/>
<arg value="${server.port}"/>
<arg value="${server.user}@${server.host}"/>
<arg value="mkdir -vp ${server.dir}/app/code/community/${extension.module.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.module.company}/${extension.module.name}"/>
<arg value="${server.user}@${server.host}:${server.dir}/app/code/community/${extension.module.company}" />
</exec>
<exec executable="rsync">
<arg value="-e"/>
<arg value="ssh -p${server.port}"/>
<arg value="-vza"/>
<arg value="--relative"/>
<arg value="--delete"/>
<arg value="${app.design.dir}/./adminhtml/default/default/layout/${extension.dirname}.xml"/>
<arg value="${app.design.dir}/./adminhtml/default/default/template/${extension.dirname}"/>
<arg value="${server.user}@${server.host}:${server.dir}/app/design" />
</exec>
<exec executable="rsync">
<arg value="-e"/>
<arg value="ssh -p${server.port}"/>
<arg value="-vza"/>
<arg value="--delete"/>
<arg value="${app.etc.modules.dir}/${extension.module.company}_${extension.module.name}.xml"/>
<arg value="${server.user}@${server.host}:${server.dir}/app/etc/modules" />
</exec>
<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="${user.home}/.ssh/id_rsa" trust="true"
command="rm -rvf '${server.dir}/app/code/community/${extension.module.company}/${extension.module.name}' '${server.dir}/app/design/adminhtml/default/default/layout/${extension.dirname}.xml' '${server.dir}/app/design/adminhtml/default/default/template/${extension.dirname}' '${server.dir}/app/etc/modules/${extension.module.company}_${extension.module.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.module.company}"/>
<symlink link="${magento.dir}/app/code/community/${extension.module.company}/" resource="${app.code.community.dir}/${extension.module.company}/${extension.module.name}" failonerror="false"/>
<symlink link="${magento.dir}/app/design/adminhtml/default/default/layout/" resource="${app.design.dir}/adminhtml/default/default/layout/${extension.dirname}.xml" failonerror="false"/>
<symlink link="${magento.dir}/app/design/adminhtml/default/default/template/${extension.dirname}" resource="${app.design.dir}/adminhtml/default/default/template/${extension.dirname}" failonerror="false"/>
<copy file="${app.etc.modules.dir}/${extension.module.company}_${extension.module.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.module.company}/${extension.module.name}" failonerror="false"/>
<symlink action="delete" link="${magento.dir}/app/design/adminhtml/default/default/layout/${extension.dirname}.xml" failonerror="false"/>
<symlink action="delete" link="${magento.dir}/app/design/adminhtml/default/default/template/${extension.dirname}" failonerror="false"/>
<delete file="${magento.dir}/app/etc/modules/${extension.module.company}_${extension.module.name}.xml" />
</target>
</project>