| 1 |
#!/bin/bash |
|---|
| 2 |
# use this script like: |
|---|
| 3 |
# md5-amp_conf.sh 1.10.00X |
|---|
| 4 |
|
|---|
| 5 |
# WARNING: THIS IS HARDCODED TO THE 2.3 BRANCH |
|---|
| 6 |
# |
|---|
| 7 |
# TODO: SHOULD CHECK THE VERSION OF THE MODULES BEFORE PROCEEDING |
|---|
| 8 |
# |
|---|
| 9 |
module_url="http://www.freepbx.org/v2/svn/modules/branches/2.10" |
|---|
| 10 |
core_url=${module_url}/core |
|---|
| 11 |
framework_url=${module_url}/framework |
|---|
| 12 |
fw_ari_url=${module_url}/fw_ari |
|---|
| 13 |
cdr_url=${module_url}/cdr |
|---|
| 14 |
dashboard_url=${module_url}/dashboard |
|---|
| 15 |
customappsreg_url=${module_url}/customappsreg |
|---|
| 16 |
voicemail_url=${module_url}/voicemail |
|---|
| 17 |
recordings_url=${module_url}/recordings |
|---|
| 18 |
music_url=${module_url}/music |
|---|
| 19 |
featurecodeadmin_url=${module_url}/featurecodeadmin |
|---|
| 20 |
infoservices_url=${module_url}/infoservices |
|---|
| 21 |
|
|---|
| 22 |
case "$1" in |
|---|
| 23 |
?*) |
|---|
| 24 |
|
|---|
| 25 |
ver=$1 |
|---|
| 26 |
|
|---|
| 27 |
cd .. |
|---|
| 28 |
|
|---|
| 29 |
# Make sure everything is up-to-date |
|---|
| 30 |
svn update |
|---|
| 31 |
|
|---|
| 32 |
# Now make sure javascript library reflects all the changes |
|---|
| 33 |
cd buildtools |
|---|
| 34 |
./pack_javascripts.php |
|---|
| 35 |
cd .. |
|---|
| 36 |
svn ci --message "Auto checkin packed libfreepbx.javascripts.js as part of build process" amp_conf/htdocs/admin/assets/js/pbxlib.js.php |
|---|
| 37 |
|
|---|
| 38 |
# This adds the MD5 Sum for all the relevant files that gets checked in on the next steps below |
|---|
| 39 |
# |
|---|
| 40 |
cd amp_conf |
|---|
| 41 |
find agi-bin astetc bin htdocs htdocs_panel moh sbin sounds -type f | xargs md5sum | grep -v .svn > ../upgrades/$ver.md5 |
|---|
| 42 |
|
|---|
| 43 |
;; |
|---|
| 44 |
*) |
|---|
| 45 |
|
|---|
| 46 |
echo "usage: generate-release.sh <version>"; |
|---|
| 47 |
exit |
|---|
| 48 |
|
|---|
| 49 |
;; |
|---|
| 50 |
esac |
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
# Prepare and checkin the MD5 Sum |
|---|
| 54 |
# |
|---|
| 55 |
cd ../upgrades |
|---|
| 56 |
svn add $ver.md5 |
|---|
| 57 |
svn ps svn:mime-type text/plain $ver.md5 |
|---|
| 58 |
svn ps svn:eol-style native $ver.md5 |
|---|
| 59 |
svn ci -m "Creating release $ver" |
|---|
| 60 |
|
|---|
| 61 |
# Back up to the top, do an svn info to get the URL so we can use it to create a tag |
|---|
| 62 |
# |
|---|
| 63 |
cd .. |
|---|
| 64 |
cur=`svn info | grep URL | awk ' { print $2 }'` |
|---|
| 65 |
svn cp -m "Automatic tag of $ver" $cur http://www.freepbx.org/v2/svn/freepbx/tags/$ver |
|---|
| 66 |
|
|---|
| 67 |
# Now that the tag is made, we want to add core and framework to the tag so that |
|---|
| 68 |
# the tag reflects the tarball. Then we will use the tag to generate the releases |
|---|
| 69 |
# |
|---|
| 70 |
svn cp -m "Automatic packaging of core with $ver" $core_url http://www.freepbx.org/v2/svn/freepbx/tags/${ver}/amp_conf/htdocs/admin/modules/ |
|---|
| 71 |
svn cp -m "Automatic packaging of framework with $ver" $framework_url http://www.freepbx.org/v2/svn/freepbx/tags/${ver}/amp_conf/htdocs/admin/modules/ |
|---|
| 72 |
svn cp -m "Automatic packaging of fw_ari with $ver" $fw_ari_url http://www.freepbx.org/v2/svn/freepbx/tags/${ver}/amp_conf/htdocs/admin/modules/ |
|---|
| 73 |
svn cp -m "Automatic packaging of cdr with $ver" $cdr_url http://www.freepbx.org/v2/svn/freepbx/tags/${ver}/amp_conf/htdocs/admin/modules/ |
|---|
| 74 |
svn cp -m "Automatic packaging of dashboard with $ver" $dashboard_url http://www.freepbx.org/v2/svn/freepbx/tags/${ver}/amp_conf/htdocs/admin/modules/ |
|---|
| 75 |
svn cp -m "Automatic packaging of customappsreg with $ver" $customappsreg_url http://www.freepbx.org/v2/svn/freepbx/tags/${ver}/amp_conf/htdocs/admin/modules/ |
|---|
| 76 |
svn cp -m "Automatic packaging of voicemail with $ver" $voicemail_url http://www.freepbx.org/v2/svn/freepbx/tags/${ver}/amp_conf/htdocs/admin/modules/ |
|---|
| 77 |
svn cp -m "Automatic packaging of recordings with $ver" $recordings_url http://www.freepbx.org/v2/svn/freepbx/tags/${ver}/amp_conf/htdocs/admin/modules/ |
|---|
| 78 |
svn cp -m "Automatic packaging of music with $ver" $music_url http://www.freepbx.org/v2/svn/freepbx/tags/${ver}/amp_conf/htdocs/admin/modules/ |
|---|
| 79 |
svn cp -m "Automatic packaging of featurecodeadmin with $ver" $featurecodeadmin_url http://www.freepbx.org/v2/svn/freepbx/tags/${ver}/amp_conf/htdocs/admin/modules/ |
|---|
| 80 |
svn cp -m "Automatic packaging of infoservices with $ver" $infoservices_url http://www.freepbx.org/v2/svn/freepbx/tags/${ver}/amp_conf/htdocs/admin/modules/ |
|---|
| 81 |
|
|---|
| 82 |
# Now clear out the release diretory where we will build the tarballs and grab it from the tag to get core and framework |
|---|
| 83 |
# |
|---|
| 84 |
mkdir -p /tmp/freepbx-release |
|---|
| 85 |
rm -rf /tmp/freepbx-release/freepbx-$ver |
|---|
| 86 |
|
|---|
| 87 |
# Use the tag to build the tarball |
|---|
| 88 |
# |
|---|
| 89 |
svn export http://www.freepbx.org/v2/svn/freepbx/tags/$ver /tmp/freepbx-release/freepbx-$ver |
|---|
| 90 |
|
|---|
| 91 |
cd /tmp/freepbx-release |
|---|
| 92 |
tar zcvf freepbx-$ver.tar.gz freepbx-$ver |
|---|
| 93 |
|
|---|
| 94 |
######################################################################################### |
|---|
| 95 |
# We don't make a full version with modules anymore so comment this out |
|---|
| 96 |
# cd freepbx-$ver/amp_conf/htdocs/admin/modules/ |
|---|
| 97 |
# . ./import.sh |
|---|
| 98 |
# |
|---|
| 99 |
# # import should not bring in core and framework, those were removed from its list |
|---|
| 100 |
# # |
|---|
| 101 |
# find . -name .svn -exec rm -rf {} \; |
|---|
| 102 |
# cd /usr/src/freepbx-release |
|---|
| 103 |
# tar zcvf freepbx-$ver-withmodules.tar.gz freepbx-$ver |
|---|
| 104 |
# |
|---|
| 105 |
######################################################################################### |
|---|