wiki:ReleasingApplications

Releasing Applications

Creating a new release

if you are just updating the current release, you can skip this

Update Build Version

First, open 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 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 ant/include/build.version to trunk.

You should also create a new "version" in trac for this in the Admin -> Versions page.

Create a release branch

You should then create a branch for this release. The branch should be created in the branches/releases directory with the name "release_<major>.<minor>.x".

For example, for version 1.0.0, the branch 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 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.

Tagging Specific Release

Once you've updated and committed ServerPrefs? to the maintenance branch, you should tag the release. Create a tag from the release branch in the tags/releases directory with the name "release_<major>.<minor>.<build>". In this case you should use a fully qualified name, such as 1.2.0 instead of 1.2.x because this is a tag of an actual release, not a maintenance branch.

Setup Tomcat production dir

SSH into opensha@opensha.usc.edu then navigate to the Tomcat development build directory (for more information see 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/share/tomcat/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/share/tomcat/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/share/tomcat/webapps/OpenSHA/WEB-INF: ./rebuild.sh 

Then make sure the web.xml files is updated for any new servlets:

[3:opensha] /usr/share/tomcat/webapps/OpenSHA/WEB-INF: cp conf/web.xml .

Then restart Tomcat:

[4:opensha] /usr/share/tomcat/webapps/OpenSHA/WEB-INF: cd ant/
[5:opensha] /usr/share/tomcat/webapps/OpenSHA/WEB-INFF/ant: ./runAnt.sh cc-build-test.xml restart.tomcat

Updating the current release

if you just created a new release above, you can 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 trunk as well, then commit the change, merge to updated build number to the release branch, and commit it. See Update Build Version above.

Then tag the release, see #TaggingSpecificRelease 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 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/share/tomcat/webapps/OpenSHA/WEB-INF

Then rebuild the project:

[2:opensha] /usr/share/tomcat/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 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/share/tomcat/webapps/OpenSHA/WEB-INF/ant

Build the applications using the MultiAppBuilder.xml ant build file's "build.dist" target:

[2:opensha] /usr/share/tomcat/webapps/OpenSHA/WEB-INFF/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 CompleteJar.xml ant build file's "build.dist" target:

[3:opensha] /usr/share/tomcat/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?."

NOTE: As of 1/10/14 (1.3 release), progress is for some reason not shown when you tell it to build. It is actually building which can be seen by doing a "ps gx" on opensha, just not showing progress.

And that's it!

Last modified 7 months ago Last modified on Sep 28, 2016, 12:21:23 PM