forked from jfusion/org.jfusion.jfusion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_release.sh
executable file
·236 lines (191 loc) · 11.7 KB
/
create_release.sh
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
#!/bin/bash
FULLPATH="$PWD"
if [ -f "/usr/bin/7z" ]; then
USEZIPCMD="7z"
ZIPCMD="/usr/bin/7z"
elif [ -f "/usr/bin/zip" ]; then
USEZIPCMD="zip"
ZIPCMD="/usr/bin/zip"
else
echo "No zip program found! Install p7zip-full or zip!"
exit 0
fi
case $1 in
clear_packages)
echo "delete old package zip files"
cd $FULLPATH
rm administrator/components/com_jfusion/packages/*.zip
;;
clear_main)
echo "delete old main zip files"
cd $FULLPATH
rm *.zip
;;
clear)
$0 clear_main
$0 clear_packages
;;
create_packages)
$0 clear_packages
echo "create the new packages for the plugins and module"
#login module has folders thus has to be treated differently
if [ "$USEZIPCMD" == "zip" ];
then
cd $FULLPATH/modules/mod_jfusion_login
$ZIPCMD -r $FULLPATH/administrator/components/com_jfusion/packages/jfusion_mod_login.zip . -x *.svn* > /dev/null
cd $FULLPATH
cd $FULLPATH/modules/mod_jfusion_activity
$ZIPCMD -r $FULLPATH/administrator/components/com_jfusion/packages/jfusion_mod_activity.zip . -x *.svn* > /dev/null
cd $FULLPATH
cd $FULLPATH/modules/mod_jfusion_whosonline
$ZIPCMD -r $FULLPATH/administrator/components/com_jfusion/packages/jfusion_mod_whosonline.zip . -x *.svn* > /dev/null
cd $FULLPATH
cd $FULLPATH/modules/mod_jfusion_user_activity
$ZIPCMD -r $FULLPATH/administrator/components/com_jfusion/packages/jfusion_mod_user_activity.zip . -x *.svn* > /dev/null
cd $FULLPATH
$ZIPCMD -rj $FULLPATH/administrator/components/com_jfusion/packages/jfusion_plugin_auth.zip plugins/authentication -x *.svn* > /dev/null
$ZIPCMD -rj $FULLPATH/administrator/components/com_jfusion/packages/jfusion_plugin_user.zip plugins/user -x *.svn* > /dev/null
$ZIPCMD -rj $FULLPATH/administrator/components/com_jfusion/packages/jfusion_plugin_search.zip plugins/search -x *.svn* > /dev/null
cd $FULLPATH/plugins/content
$ZIPCMD -r $FULLPATH/administrator/components/com_jfusion/packages/jfusion_plugin_content.zip . -x *.svn* > /dev/null
cd $FULLPATH
$ZIPCMD -j $FULLPATH/administrator/components/com_jfusion/packages/jfusion_plugin_system.zip plugins/system/jfusion.php plugins/system/jfusion.xml -x *.svn* > /dev/null
$ZIPCMD -rj $FULLPATH/administrator/components/com_jfusion/packages/jfusion_plugin_override.zip plugins/override -x *.svn* > /dev/null
cd $FULLPATH/modules/mod_jfusion_magecart
$ZIPCMD -r $FULLPATH/side_projects/magento/jfusion_mod_magecart.zip . -x *.svn* > /dev/null
cd $FULLPATH/modules/mod_jfusion_mageselectblock
$ZIPCMD -r $FULLPATH/side_projects/magento/jfusion_mod_mageselectblock.zip . -x *.svn* > /dev/null
cd $FULLPATH/modules/mod_jfusion_magecustomblock
$ZIPCMD -r $FULLPATH/side_projects/magento/jfusion_mod_magecustomblock.zip . -x *.svn* > /dev/null
cd $FULLPATH/plugins/system
$ZIPCMD -r $FULLPATH/side_projects/magento/jfusion_plugin_magelib.zip ./magelib.* -x *.svn* > /dev/null
cd $FULLPATH/components/com_jfusion/plugins/dokuwiki
$ZIPCMD -r "$FULLPATH/pluginpackages/jfusion_dokuwiki.zip" -x *.svn* > /dev/null
cd $FULLPATH/components/com_jfusion/plugins/efront
$ZIPCMD -r "$FULLPATH/pluginpackages/jfusion_efront.zip" -x *.svn* > /dev/null
cd $FULLPATH/components/com_jfusion/plugins/elgg
$ZIPCMD -r "$FULLPATH/pluginpackages/jfusion_elgg.zip" -x *.svn* > /dev/null
cd $FULLPATH/components/com_jfusion/plugins/gallery2
$ZIPCMD -r "$FULLPATH/pluginpackages/jfusion_gallery2.zip" -x *.svn* > /dev/null
cd $FULLPATH/components/com_jfusion/plugins/joomla_ext
$ZIPCMD -r "$FULLPATH/pluginpackages/jfusion_joomla_ext.zip" -x *.svn* > /dev/null
cd $FULLPATH/components/com_jfusion/plugins/joomla_int
$ZIPCMD -r "$FULLPATH/pluginpackages/jfusion_joomla_int.zip" -x *.svn* > /dev/null
cd $FULLPATH/components/com_jfusion/plugins/magento
$ZIPCMD -r "$FULLPATH/pluginpackages/jfusion_magento.zip" -x *.svn* > /dev/null
cd $FULLPATH/components/com_jfusion/plugins/mediawiki
$ZIPCMD -r "$FULLPATH/pluginpackages/jfusion_mediawiki.zip" -x *.svn* > /dev/null
cd $FULLPATH/components/com_jfusion/plugins/moodle
$ZIPCMD -r "$FULLPATH/pluginpackages/jfusion_moodle.zip" -x *.svn* > /dev/null
cd $FULLPATH/components/com_jfusion/plugins/mybb
$ZIPCMD -r "$FULLPATH/pluginpackages/jfusion_mybb.zip" -x *.svn* > /dev/null
cd $FULLPATH/components/com_jfusion/plugins/oscommerce
$ZIPCMD -r "$FULLPATH/pluginpackages/jfusion_oscommerce.zip" -x *.svn* > /dev/null
cd $FULLPATH/components/com_jfusion/plugins/phpbb3
$ZIPCMD -r "$FULLPATH/pluginpackages/jfusion_phpbb3.zip" -x *.svn* > /dev/null
cd $FULLPATH/components/com_jfusion/plugins/prestashop
$ZIPCMD -r "$FULLPATH/pluginpackages/jfusion_prestashop.zip" -x *.svn* > /dev/null
cd $FULLPATH/components/com_jfusion/plugins/smf
$ZIPCMD -r "$FULLPATH/pluginpackages/jfusion_smf.zip" -x *.svn* > /dev/null
cd $FULLPATH/components/com_jfusion/plugins/smf2
$ZIPCMD -r "$FULLPATH/pluginpackages/jfusion_smf2.zip" -x *.svn* > /dev/null
cd $FULLPATH/components/com_jfusion/plugins/universal
$ZIPCMD -r "$FULLPATH/pluginpackages/jfusion_universal.zip" -x *.svn* > /dev/null
cd $FULLPATH/components/com_jfusion/plugins/vbulletin
$ZIPCMD -r "$FULLPATH/pluginpackages/jfusion_vbulletin.zip" -x *.svn* > /dev/null
cd $FULLPATH/components/com_jfusion/plugins/wordpress
$ZIPCMD -r "$FULLPATH/pluginpackages/jfusion_wordpress.zip" -x *.svn* > /dev/null
else
cd $FULLPATH/modules/
$ZIPCMD a "$FULLPATH/administrator/components/com_jfusion/packages/jfusion_mod_activity.zip" ./mod_jfusion_activity/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/administrator/components/com_jfusion/packages/jfusion_mod_login.zip" ./mod_jfusion_login/* -r -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/administrator/components/com_jfusion/packages/jfusion_mod_whosonline.zip" ./mod_jfusion_whosonline/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/administrator/components/com_jfusion/packages/jfusion_mod_user_activity.zip" ./mod_jfusion_user_activity/* -xr!*.svn* > /dev/null
cd $FULLPATH/plugins/
$ZIPCMD a "$FULLPATH/administrator/components/com_jfusion/packages/jfusion_plugin_auth.zip" ./authentication/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/administrator/components/com_jfusion/packages/jfusion_plugin_user.zip" ./user/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/administrator/components/com_jfusion/packages/jfusion_plugin_search.zip" ./search/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/administrator/components/com_jfusion/packages/jfusion_plugin_content.zip" ./content/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/administrator/components/com_jfusion/packages/jfusion_plugin_system.zip" ./system/jfusion.* -xr!*.svn* > /dev/null
echo "create the new packages for the Magento Integration"
cd $FULLPATH/modules/
$ZIPCMD a "$FULLPATH/side_projects/magento/jfusion_mod_magecart.zip" ./mod_jfusion_magecart/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/side_projects/magento/jfusion_mod_mageselectblock.zip" ./mod_jfusion_mageselectblock/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/side_projects/magento/jfusion_mod_magecustomblock.zip" ./mod_jfusion_magecustomblock/* -xr!*.svn* > /dev/null
cd $FULLPATH/plugins/
$ZIPCMD a "$FULLPATH/side_projects/magento/jfusion_plugin_magelib.zip" ./system/magelib.* -xr!*.svn* > /dev/null
cd $FULLPATH/components/com_jfusion/plugins
$ZIPCMD a "$FULLPATH/pluginpackages/jfusion_dokuwiki.zip" ./dokuwiki/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/pluginpackages/jfusion_efront.zip" ./efront/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/pluginpackages/jfusion_elgg.zip" ./elgg/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/pluginpackages/jfusion_gallery2.zip" ./gallery2/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/pluginpackages/jfusion_joomla_ext.zip" ./joomla_ext/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/pluginpackages/jfusion_joomla_int.zip" ./joomla_int/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/pluginpackages/jfusion_magento.zip" ./magento/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/pluginpackages/jfusion_mediawiki.zip" ./mediawiki/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/pluginpackages/jfusion_moodle.zip" ./moodle/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/pluginpackages/jfusion_mybb.zip" ./mybb/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/pluginpackages/jfusion_oscommerce.zip" ./oscommerce/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/pluginpackages/jfusion_phpbb3.zip" ./phpbb3/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/pluginpackages/jfusion_prestashop.zip" ./prestashop/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/pluginpackages/jfusion_smf.zip" ./smf/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/pluginpackages/jfusion_smf2.zip" ./smf2/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/pluginpackages/jfusion_vbulletin.zip" ./vbulletin/* -xr!*.svn* > /dev/null
$ZIPCMD a "$FULLPATH/pluginpackages/jfusion_wordpress.zip" ./wordpress/* -xr!*.svn* > /dev/null
cd $FULLPATH
fi
;;
create_main)
$0 clear_main
echo "Prepare the files for packaging"
mkdir tmp
mkdir tmp/admin
rsync -r --exclude=".*/" components/com_jfusion/* tmp/admin
rsync -r --exclude=".*/" pluginpackages/* tmp/admin/packages
rm tmp/admin/jfusion.xml
mkdir tmp/admin/languages
rsync -r --exclude=".*/" administrator/language/* tmp/admin/languages
mkdir tmp/front
rsync -r --exclude=".*/" --exclude="plugins" components/com_jfusion/* tmp/front
mkdir tmp/front/languages
rsync -r --exclude=".*/" language/* tmp/front/languages/
rsync administrator/components/com_jfusion/jfusion.xml administrator/components/com_jfusion/install.jfusion.php administrator/components/com_jfusion/uninstall.jfusion.php tmp/
echo "Update the revision number"
if which git &> /dev/null; then
mv tmp/jfusion.xml tmp/jfusion.tmp
VERSION=$(git rev-parse HEAD)
sed "s/<revision>\$revision\$<\/revision>/<revision>$VERSION<\/revision>/g" tmp/jfusion.tmp > tmp/jfusion.xml
rm tmp/jfusion.tmp
else
echo "git is not available. Install git command line client."
fi
echo "Revision set to $VERSION"
echo "Create the new master package"
if [ "$USEZIPCMD" == "zip" ];
then
cd tmp
$ZIPCMD -r $FULLPATH/jfusion_package.zip . > /dev/null
else
cd $FULLPATH
$ZIPCMD a "$FULLPATH/jfusion_package.zip" ./tmp/* -xr!*.svn* > /dev/null
fi
echo "Create a ZIP containing all files to allow for easy updates"
cd $FULLPATH
if [ "$USEZIPCMD" == "zip" ];
then
$ZIPCMD -r jfusion_files.zip administrator components language modules plugins -x *.svn* > /dev/null
else
$ZIPCMD a "$FULLPATH/jfusion_files.zip" administrator components language modules plugins -r -xr!*.svn* > /dev/null
fi
echo "Remove temporary files"
rm -r tmp
;;
create)
$0 create_packages
$0 create_main
;;
*)
echo "Usage $FULLPATH/create_package.sh {clear_packages|clear_main|clear|create_main|create_packages|create}"
;;
esac
exit 0