Skip to content

Devguide building a melody distribution

jayallen edited this page Apr 19, 2011 · 4 revisions

How to Build a Melody Distribution

The following is a running log of the actual process I went through to build the Melody 1.0 RC2 distribution.

Update version and git tag

Edit the following three files to update the Melody version and Version ID:

  • lib/MT.pm
  • build/mt-dists/default.mk
  • php/mt.php

Add the files to your git staging area

git add build/mt-dists/default.mk lib/MT.pm php/mt.php

Commit the changes

git ci -m"Melody 1.0 Release candidate 2 (build 36)"

Tag the repo with the latest tag

git tag -a v1.0.0_rc2-36 \
        -m"Tagging Melody 1.0 (Release candidate 2, build 36)"

We'll push this update to the master repo later. For now, we have other things to do first.

Creating the release notes

Output the following command to a text file or editor:

./dev/melody relnotes --start v1.0.0_rc1-35

Edit the text replacing instances of EDIT_ME_PLEASE with the appropriate values

Create a page on the wiki with this text as the body, matching the release filename minus the build number and replacing "melody" with "release", e.g.

melody-v1.0.0_rc1-35

becomes

https://github.com/openmelody/melody/wiki/release-v1.0.0_rc2

Ask ops@openmelody.org to edit the top section highlighting the big changes in the release

Creating a clean "build" directory

You never want to build Melody from your normal repo working directory. Instead, you want to create a "build" directory which is clean of all of your development cruft. This is done with the following command, executed outside of your Melody working directory:

git clone  MELODY_REPO_PATH   BUILD_REPO_DIRNAME

For example, if your melody working directory is named melody-repo:

cd ..    # Out of your working directory
git clone melody-repo  melody-build

This creates a local clone of your Melody repo without any extraneous files or other clutter you might have in your working directory.

Building the distribution

cd melody-build
make realclean
./build/melody/minify-static
./build/mt-dists/make-js 
perl Makefile.PL

You'll get a lot of warnings here about missing files. They are usually files that were removed during development. Just peruse the list to make sure those files should NOT be in the repo. Tim Appnel normally manages this list.

make
make manifest
make tardist

This creates a new distribution, Melody-v0.9.36.tar.gz, which needs to be edited because it has the wrong file name and archived directory name.

tar xvfz Melody-v0.9.36.tar.gz && rm Melody-v0.9.36.tar.gz
mv Melody-v0.9.36 melody-v1.0.0_rc2-36
tar cvfz melody-v1.0.0_rc2-36.tar.gz melody-v1.0.0_rc2-36
zip -r melody-v1.0.0_rc2-36.zip melody-v1.0.0_rc2-36
rm -rf melody-v1.0.0_rc2-36

This package should be put into the proper place on the openmelody.org server:

scp melody-v1.0.0_rc2-36.zip om:melody-pkgs/

Note: om is the abbreviated version of the USER@HOST designation as defined in my ssh config.

Testing the distribution on openmelody.org

ssh om
cd /vol/www/openmelody.org/cgi-bin/
cp ~/melody-pkgs/melody-v1.0.0_rc2-36.zip  .
unzip melody-v1.0.0_rc2-36.zip 

There are a few things to carry over from the previous install:

cp melody/config.cgi melody-v1.0.0_rc2-36
cp -Rf melody/plugins/* melody-v1.0.0_rc2-36/plugins/
cp -Rf melody/mt-static/support/* melody-v1.0.0_rc2-36/mt-static/support/
mkdir melody-v1.0.0_rc2-36/mt-static/plugins  # May not be necessary
cp -Rf melody/mt-static/plugins/* melody-v1.0.0_rc2-36/mt-static/plugins/
chmod -R 777 melody-v1.0.0_rc2-36/mt-static/support/

We also need to back up the database. Just in case...:

cd melody
mysqldump -u melody -p melody > YYYYMMDD_melody.sql

Now we hard link the CGIs to .fcgi:

(
    cd melody-v1.0.0_rc2-36
    for I in index atom comments search tb xmlrpc; do
        ln $I.cgi $I.fcgi
    done
)

Switch the active melody instance to the new installation and upgrade it:

rm melody && ln -s melody-v1.0.0_rc2-36 melody
cd melody; MT_HOME=$(pwd) ./tools/upgrade --name jay
/usr/sbin/apache2ctl graceful

Finally, while testing the distribution and even for a few hours after, you should run and monitor tail -f /vol/www/openmelody.org/logs/error.log since it will often let you know when/if you screwed up.

If all went well, archive the old melody directory + SQL into the TGZ folder.

Pushing out the release

Change directories back into your Melody repo working directory and do the following

git push --tags openmelody master

Go to the openmelody github account's downloads page and upload both the tar/gzip and zip packages created above, using the same title format as the previous builds.

Next, we forcibly update the git repo on the openmelody.org server. This is done via crontab but sometimes is too slow:

ssh om "cd /vol/www/openmelody.org/cgi-bin/github-melody-repo && git pull"

Go to the openmelody.org download page to make sure that the correct package is offered for download. Edit the release information on the download page entry and save.

Making the release announcement

Clone this wiki locally