*\[N.B.: I'm in the middle of a rewrite and this is a work in progress.   \--amb 3jan2008\]*

Contents:

  1. Prepration
  2. Code Build and Release
  3. Deploying Static HTML

PREPARATION 

ARE YOU DOING A RELEASE?
Before deploying anything, confirm that you won't interrupt anyone else's work:

BEFORE STARTING:

  1. Make sure all developers have checked in their code.
  2. For releases, make sure everyone has resolved their fixed bugs so the release notes are accurate.
  3. Make sure you have no uncommitted code hanging around in your local working copy, if that's what you're using for the build. ("svn status")

CODE BUILD AND RELEASE

Thalia code has two pieces: the IME back end, which is a Java .war file, and the .swf front end, which is written in OpenLazlo. The .swf front-end is built into the IME's .war file, although it's actually a distinct build and may be a separate .war file at some point in the future.

GENERAL DEPENDENCIES

To build either part of thalia, you need the following tools which you may already have (and which are already installed on isda-build1):

BUILD PREPARATION

  1. Check out the Thalia code: 
    svn checkout svn+ssh://username@svn.mit.edu/zest/thalia
  2. For a release, create the release branch:
    svn cp ime/Trunk/thalia ime/Branches/thalia<version>-sprint<num>

FRONT END
BACK END

  1. For a release, create the release branch:
    svn cp ime/Trunk/thalia ime/Branches/thalia<version>-sprint<num>
  2. Make a clean build of the .war file:
    cd thalia/ime/Branches/thalia<ver>-sprint<num>
    mvn clean package -Denv=prod1
    This will create or update the target directory and add the file ROOT.war .  Please note that the Thalia maven build has multiple profiles:
  1. If you're doing a release and the build completed without error, commit the branch. 
    svn commit
  2. Deploy the war:
    a.  Check that it's ok to deploy.  Start in the thalia-talk chat  .  If deploying to QA, check in with the QA contractor in thalia-qa . If deploying to production, you will already have emailed asst@mit.edu about the scheduled down time ahead of time so they will not be alarmed when the nagios service fails on Thalia. 

    6.  There are two ways to deploy: one through the web, and one via maven.  Do one of the following:

    DEPLOY WITH MAVEN 
    a. To specify tomcat authentication info in Maven, add the following line in settings.xml in $M2_HOME/conf/settings.xml  . Username and password are for the tomcat manager. Ask if you don't have that information. 
    Maven settings are in the maven directory in conf/settings.xml. deploymentserver is used for release to the development cluster. testserver* is used for release to the test cluster. prodserver* is used for release to the production cluster.

        <server>
          <id>deploymentserver</id>
          <username>username</username>
          <password>password</password>
        </server>
        <server>
          <id>testserver1</id>
          <username>username</username>
          <password>password</password>
        </server>
        <server>
           <id>testserver2</id>
           <username>username</username>
           <password>password</password>
        </server>
       <server>
          <id>prodserver1</id>
          <username>username</username>
          <password>password</password> 
       </server>
       <server>
          <id>prodserver2</id>
          <username>username</username>
          <password>password</password>
       </server>

    c. Deploy with Maven:

    mvn tomcat:undeploy
    mvn tomcat:deploy

    This should also work:

    mvn clean tomcat:deploy
    By default this will undeploy and deploy thalia on the development server.
    To deploy to QA:
     mvn tomcat:undeploy -Denv=test1
     mvn clean tomcat:deploy -Denv=test1
     mvn tomcat:undeploy -Denv=test2
     mvn clean tomcat:deploy -Denv=test2
    To deploy to production:
     mvn tomcat:undeploy -Denv=prod1
     mvn clean tomcat:deploy -Denv=prod1
     mvn tomcat:undeploy -Denv=prod2
     mvn clean tomcat:deploy -Denv=prod2

    DEPLOY BY WEB PAGE:

There are usually two front ends per environment. You must repeat these steps on each server. Visit the tomcat manager page for each front end server. See the Thalia environments list for hostnames.

a. Download the freshly built ROOT.war from isda-build1  to your local machine.

b. Open the Tomcat server manager for each front end in a web browser.  ( http://hostname/manager/html/upload&nbsp; )

c. Undeploy the root instance, /.   .

d. Further down the page, upload ROOT.war . 

7. For all deployment methods:  Do a smoke test to confirm Thalia came back up. Brian Childs suggests:

DEPLOYING  HELP HTML PAGES

Html pages are kept in svn at svn+ssh://svn.mit.edu/zest/thalia/website/ . Html is divided into Branches and Trunk, like code, because the help changes with product versions.

To deploy static html pages,  navigate to the Branches subdirectory for the current Thalia version and sprint.

Static html is deployed from svn+ssh://svn.mit.edu/zest/thalia/website//help to /home/apache-tomcat-5.5.23/webapps/help  .    You may either copy the files with svn directly to the target machine, or make a fresh copy on your local machine and scp it over.

The entire help directory may be copied, as it is always the up to date Branched version, or only newly updated files if you have a list.

Don't deploy&nbsp; the top-level files in svn+ssh://svn.mit.edu/zest/thalia/website/ . I believe most of them are out of date, and the directory is due for a cleanup after Thalia 1.0 sprint 4 . \[jriley\]