|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +dbc_dir=`pwd` |
| 4 | + |
| 5 | +# Preconditions. |
| 6 | +echo -en "Did you add the release notes in the documentation? (Y/n) "; read ci |
| 7 | +if [ "$ci" != "Y" ]; then |
| 8 | + echo -en "ERROR: You must add the release notes before releasing\n" |
| 9 | + exit 1; |
| 10 | +fi |
| 11 | +echo -en "Did you commit to SVN? (Y/n) "; read ci |
| 12 | +if [ "$ci" != "Y" ]; then |
| 13 | + echo -en "ERROR: You must commit before releasing\n" |
| 14 | + exit 1; |
| 15 | +fi |
| 16 | + |
| 17 | +# Load release number. |
| 18 | + |
| 19 | +old_major=`cat $dbc_dir/bin/release.dat | egrep "^Major: .*$" | sed 's/^Major: //'` |
| 20 | +old_minor=`cat $dbc_dir/bin/release.dat | egrep "^Minor: .*$" | sed 's/^Minor: //'` |
| 21 | +old_rev=`cat $dbc_dir/bin/release.dat | egrep "^Revision: .*$" | sed 's/^Revision: //'` |
| 22 | + |
| 23 | +new_rev=`svn info | egrep "^Revision: .*$" | sed 's/^Revision: //'` |
| 24 | + |
| 25 | +echo |
| 26 | +echo "release-number := major.minor.subversion-revision" |
| 27 | +echo -en "New major release number [old = $old_major]: "; read new_major |
| 28 | +if [ -z "$new_major" ]; then new_major=$old_major; fi |
| 29 | +echo -en "New minor release number [old = $old_minor]: "; read new_minor |
| 30 | +if [ -z "$new_minor" ]; then new_minor=$old_minor; fi |
| 31 | +echo -en "New revision: $new_rev (current SVN revision)\n" |
| 32 | + |
| 33 | +name=contractpp_${new_major}_${new_minor}_${new_rev} |
| 34 | + |
| 35 | +# Tar ball from trunk. |
| 36 | +echo |
| 37 | +echo "Exporting SVN repository..." |
| 38 | +cd /tmp |
| 39 | +svn export https://dbcpp.svn.sourceforge.net/svnroot/dbcpp/trunk $name |
| 40 | +tar czf $name.tar.gz $name |
| 41 | + |
| 42 | +# Save release number. |
| 43 | +echo """# Lateset release-number := major.minor.subversion-revision |
| 44 | +Major: $new_major |
| 45 | +Minor: $new_minor |
| 46 | +Revision: $new_rev" > $dbc_dir/bin/release.dat |
| 47 | + |
| 48 | +# Manual steps. |
| 49 | +echo -en """ |
| 50 | +IMPORTANT: To complete the release do the following manual steps. |
| 51 | +
|
| 52 | +RELEASE FILE |
| 53 | +1. Log into 'http://sourceforge.net/projects/dbcpp/' as administrator. |
| 54 | +2. In the Summary page, click EDIT next to the download area. |
| 55 | +3. Left click on the gear next to the \"/releases\" directory. |
| 56 | +4. Click 'Upload here' and upload \"/tmp/$name.tar.gz\". |
| 57 | +5. Select the uploaded file and click Save (no need to specify label, etc). |
| 58 | + The latest uploaded file is automatically set to the download file. |
| 59 | +
|
| 60 | +DOCUMENTATION |
| 61 | +1. Open Places > Home and click on Go > Location. |
| 62 | +2. Enter 'sftp://<USER_NAME>,[email protected]' and type the password. |
| 63 | +3. Go to 'home/groups/d/db/dbcpp/htdocs' (website directory). |
| 64 | +4. Remove all files from this directory (old documentation). |
| 65 | +5. Copy (drag-n-drop) all files from 'trunk/doc/html/*' into the 'htdocs' |
| 66 | + directory opened via sftp. |
| 67 | +
|
| 68 | +DEVELOPMENT STATUS |
| 69 | +0. Update release status (Alpha, Beta, etc) but only if really necessary. |
| 70 | +1. Log into 'http://sourceforge.net/projects/dbcpp/' as administrator. |
| 71 | +2. In the Summary page, click EDIT next to the library title. |
| 72 | +3. Click Edit Trove Categorization (on the right). |
| 73 | +4. Edit the Development Status. |
| 74 | +
|
| 75 | +SUBVERSION |
| 76 | +1. Commit this sandbox to SVN -- local modiciations made by this script. |
| 77 | +""" |
| 78 | + |
0 commit comments