= Releasing Applications = [[PageOutline]] == Creating a new release == === Update Build Version === First, open [source:trunk/ant/include/utils.xml ant/include/utils.xml] in Eclipse. Run one of the following targets to update the build version: * update.major.version - updates the major (first) version. For example, this will update from 1.5.2 to 2.0.0 * update.minor.version - updates the major (first) version. For example, this will update from 1.5.2 to 1.6.0 * update.build.number - '''(only do this when [#Updatingthecurrentrelease updating the current release])''' updates the build number. For example, this will update from 1.5.2 to 1.5.3 Commit the newly modified file [source:trunk/ant/include/build.version ant/include/build.version] to trunk. === Create a release branch === You should then create a branch for this release. The branch should be created in the [source:branches/releases] directory with the name "release_..x". For example, for version 1.0.0, the branch [source:branches/releases/release_1.0.x] was created. === Update !ServerPrefs === Next, you must update the server preferences class in the new branch, and commit it to SVN. This tells various parts of the OpenSHA project that this is a release branch, and to use the "stable" server URLs/ports. In Eclipse, open the class [source:trunk/src/org/opensha/commons/util/ServerPrefUtils.java ServerPrefUtils] in org.opensha.commons.util . Find this line: {{{ public static final ServerPrefs SERVER_PREFS = ServerPrefs.DEV_PREFS; }}} And change it to: {{{ public static final ServerPrefs SERVER_PREFS = ServerPrefs.PRODUCTION_PREFS; }}} Commit this modified file to your release branch. === Setup Tomcat production dir === SSH into !opensha@opensha.usc.edu then navigate to the Tomcat development build directory (for more information see [wiki:TomcatConfig Tomcat Configuration]). {{{ kevin@milner:~$ ssh opensha@opensha.usc.edu Last login: Wed Aug 11 14:09:07 2010 from milner.usc.edu [1:opensha] ~: cd /usr/local/tomcat/default/webapps/OpenSHA/WEB-INF }}} Switch to your new release branch. For example, to switch to releases/release_1.0.x : '''(you'll have to replace this with your new release branch!)''' {{{ [2:opensha] /usr/local/tomcat/default/webapps/OpenSHA/WEB-INF: ./scripts/svn/switch_to_branch.sh releases/release_1.0.x switching to branch releases/release_1.0.x at https://source.usc.edu/svn/opensha/branches/releases/release_1.0.x At revision 6959. }}} Then rebuild the project {{{ [3:opensha] /usr/local/tomcat/default/webapps/OpenSHA/WEB-INF: ./rebuild.sh }}} Then restart Tomcat {{{ [4:opensha] /usr/local/tomcat/default/webapps/OpenSHA/WEB-INF: cd ant/ [5:opensha] /usr/local/tomcat/default/webapps/OpenSHA/WEB-INF/ant: ./runAnt.sh cc-build-test.xml restart.tomcat }}} == Updating the current release == To update the current release, first make sure all changes are in the release branch. If the changes that you need were developed in trunk, you'll need to merge the change into the release branch (and the commit it). If the change was made in the release branch and it's something you want to keep, you should merge it back to trunk. You should update the build number in the release branch as well, then commit the change. See [#UpdateBuildVersion Update Build Version] above. Once the updates are in the release branch on SVN, you'll need to update the checked out copy on the server. SSH into !opensha@opensha.usc.edu then navigate to the Tomcat development build directory (for more information see [wiki:TomcatConfig Tomcat Configuration]). {{{ kevin@milner:~$ ssh opensha@opensha.usc.edu Last login: Wed Aug 11 14:09:07 2010 from milner.usc.edu [1:opensha] ~: cd /usr/local/tomcat/default/webapps/OpenSHA/WEB-INF }}} Then rebuild the project {{{ [2:opensha] /usr/local/tomcat/default/webapps/OpenSHA/WEB-INF: ./rebuild.sh }}}