| 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="https://amportal.svn.sourceforge.net/svnroot/amportal/modules/branches/2.3" |
|---|
| 10 |
core_url=${module_url}/core |
|---|
| 11 |
framework_url=${module_url}/framework |
|---|
| 12 |
|
|---|
| 13 |
case "$1" in |
|---|
| 14 |
?*) |
|---|
| 15 |
|
|---|
| 16 |
ver=$1 |
|---|
| 17 |
|
|---|
| 18 |
# Check to make sure install_amp had the new version added to the install array |
|---|
| 19 |
# |
|---|
| 20 |
grep "$ver" ../install_amp > /dev/null |
|---|
| 21 |
if [ $? -ne 0 ]; then |
|---|
| 22 |
echo No version $ver detected in the install_amp script, this should be added before building the release; |
|---|
| 23 |
fi |
|---|
| 24 |
|
|---|
| 25 |
cd .. |
|---|
| 26 |
|
|---|
| 27 |
# This adds the MD5 Sum for all the relevant files that gets checked in on the next steps below |
|---|
| 28 |
# |
|---|
| 29 |
svn update |
|---|
| 30 |
cd amp_conf |
|---|
| 31 |
find agi-bin astetc bin htdocs htdocs_panel mohmp3 sbin sounds -type f \! -name 'vm_email.inc' \! -name 'defines.php' \! -name 'op_server.cfg' \! -name 'dialparties.agi' \! -name 'manager.conf' \! -name '*.pl' \! -name 'cdr_mysql.conf' \! -name 'voicemail.conf' | xargs md5sum | grep -v .svn > ../upgrades/$ver.md5 |
|---|
| 32 |
|
|---|
| 33 |
;; |
|---|
| 34 |
*) |
|---|
| 35 |
|
|---|
| 36 |
echo "usage: generate-release.sh <version>"; |
|---|
| 37 |
exit |
|---|
| 38 |
|
|---|
| 39 |
;; |
|---|
| 40 |
esac |
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
# Prepare and checkin the MD5 Sum |
|---|
| 44 |
# |
|---|
| 45 |
cd ../upgrades |
|---|
| 46 |
svn add $ver.md5 |
|---|
| 47 |
svn ps svn:mime-type text/plain $ver.md5 |
|---|
| 48 |
svn ps svn:eol-style native $ver.md5 |
|---|
| 49 |
svn ci -m "Creating release $ver" |
|---|
| 50 |
|
|---|
| 51 |
# Back up to the top, do an svn info to get the URL so we can use it to create a tag |
|---|
| 52 |
# |
|---|
| 53 |
cd .. |
|---|
| 54 |
cur=`svn info | grep URL | awk ' { print $2 }'` |
|---|
| 55 |
svn cp -m "Automatic tag of $ver" $cur https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/tags/$ver |
|---|
| 56 |
|
|---|
| 57 |
# Now that the tag is made, we want to add core and framework to the tag so that |
|---|
| 58 |
# the tag reflects the tarball. Then we will use the tag to generate the releases |
|---|
| 59 |
# |
|---|
| 60 |
svn cp -m "Automatic packaging of core with $ver" $core_url https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/tags/${ver}/amp_conf/htdocs/admin/modules/ |
|---|
| 61 |
svn cp -m "Automatic packaging of framework with $ver" $framework_url https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/tags/${ver}/amp_conf/htdocs/admin/modules/ |
|---|
| 62 |
|
|---|
| 63 |
# Now clear out the release diretory where we will build the tarballs and grab it from the tag to get core and framework |
|---|
| 64 |
# |
|---|
| 65 |
mkdir -p /usr/src/freepbx-release |
|---|
| 66 |
rm -rf /usr/src/freepbx-release/freepbx-$ver |
|---|
| 67 |
|
|---|
| 68 |
# Use the tag to build the tarball |
|---|
| 69 |
# |
|---|
| 70 |
svn export https://amportal.svn.sourceforge.net/svnroot/amportal/freepbx/tags/$ver /usr/src/freepbx-release/freepbx-$ver |
|---|
| 71 |
|
|---|
| 72 |
cd /usr/src/freepbx-release |
|---|
| 73 |
tar zcvf freepbx-$ver.tar.gz freepbx-$ver |
|---|
| 74 |
cd freepbx-$ver/amp_conf/htdocs/admin/modules/ |
|---|
| 75 |
. ./import.sh |
|---|
| 76 |
|
|---|
| 77 |
# import should not bring in core and framework, those were removed from its list |
|---|
| 78 |
# |
|---|
| 79 |
find . -name .svn -exec rm -rf {} \; |
|---|
| 80 |
cd /usr/src/freepbx-release |
|---|
| 81 |
tar zcvf freepbx-$ver-withmodules.tar.gz freepbx-$ver |
|---|