= Releasing Applications = [[PageOutline]] == Creating a new release == ''if you are just updating the current release, you can [#Updatingthecurrentrelease skip this]'' === 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 minor (second) 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. You should also create a new "version" in trac for this in the [/admin/ticket/versions Admin -> Versions] page. === 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 == ''if you just created a new release above, you can [#Buildingtheapplications skip this]'' 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 }}} == Building the applications == === Method 1: via SSH (old method) === Once the Tomcat directory is all setup and updated, it's time to build the applications! SSH into !opensha@opensha.usc.edu then navigate to the "ant" sub-directory of 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/ant }}} Build the applications using the [source:trunk/ant/MultiAppBuilder.xml MultiAppBuilder.xml] ant build file's "build.dist" target: {{{ [2:opensha] /usr/local/tomcat/default/webapps/OpenSHA/WEB-INF/ant: ./runAnt.sh MultiAppBuilder.xml build.dist Buildfile: MultiAppBuilder.xml ... BUILD SUCCESSFUL Total time: 4 minutes 6 seconds }}} Then build the jar distributions using the [source:trunk/ant/CompleteJar.xml CompleteJar.xml] ant build file's "build.dist" target: {{{ [3:opensha] /usr/local/tomcat/default/webapps/OpenSHA/WEB-INF/ant: ./runAnt.sh CompleteJar.xml build.dist Buildfile: CompleteJar.xml ... BUILD SUCCESSFUL Total time: 1 minute 37 seconds }}} === Method 2: via CruiseControl Dashboard === The easiest way to build the applications is via the CruiseControl Dashboard. This is the preferred method because it maintains logs of each successful build. Simply visit the [Dashboard http://opensha.usc.edu:8080/dashboard/tab/builds] and enter your login/password. The click the force build button to the right of "OpenSHA-DistManualAppBuild" (hint: it looks like a browser's refresh button). The build will be queued, then you will see the build status as it runs. To view the output of the build in real time, click on "OpenSHA-DistManualAppBuild." And that's it!