Dukes Bank Migrating a Release from Development to Staging
From ControlTier
This is part of the DukesBank portion of the ControlTier Demo
Contents |
Overview
In this demo we are simulating a development to staging lifecycle. We are going to make a source code change in development, deploy it to our "development" Dukes Bank instance and verify the change, and then deploy those same changes to our "staging" Dukes Bank instance. In this example we're codeploying both instances of Dukes Bank on the same OS instance as the ControlTier server (localhost), but as we show in future demos, deploying each instance across multiple machines is just as easy with ControlTier.
Watch a video of this demo (less than 5:00)
Prerequisites
This demo assumes you have completed the Dukes Bank Setup.
Preparation
Ensure objects are deployed to CTL client
Before getting started confirm that all of the necessary objects are deployed to CTL.
Run the ctl-project command:
ctl-project -p demo -a install
Output:
"Install" command running for resource: (Site) developmentDukesBank "Install" command running for resource: (HsqldbRdb) stagingDukesBank "Install" command running for resource: (JBossServer) developmentDukesBank "Install" command running for resource: (Updater) developmentDukesBank "Install" command running for resource: (HsqldbRdb) developmentDukesBank "Install" command running for resource: (JBossAntBuilder) dukesBank "Install" command running for resource: (DukesBankProjectBuilder) dukesbank "Install" command running for resource: (CruiseControl) development "Install" command running for resource: (JBossServer) stagingDukesBank "Install" command running for resource: (HsqldbRdbExportBuilder) dukesBank "Install" command running for resource: (Site) stagingDukesBank
Deploy staging instance of JBoss
Deploy the JBoss instance that will be used for the staging instance of the Dukes Bank demo. This command and its output is very similar to what you did for deploying the development instance in the first JBoss provisioning demo.
ctl -p demo -t JBossServer -r stagingDukesBank -c Deploy
Verify that the JBoss instance is functioning by navigating to its management web page: http://localhost:8280/ (or your server's hostname)
Make a code change and deploy it to development
If you haven't already performed the previous demo, go ahead and do so now. In that demo you will make a code change to Dukes Bank app and deploy it to the development instance.
At the end of that demo, you'll be able to verify your changes ( http://localhost:8180/bank/main )
Deploy same package to staging
In this step you are going to be deploying the same package you created and tested in development to the staging instance of Dukes Bank.
ctl -p demo -t Updater -r stagingDukesBank -c Update -- -buildstamp 20090123-demo
Output:
Start: "Changes package dependencies and runs the coordinated deployment cycle across the configured Sites." commands: Change-Dependencies,Deploy begin workflow command (1/2) -> "Change-Dependencies -buildstamp 20090123-demo -resourcename .* -resourcetype [^\.]*" ... Start: "Query model and switch package dependencies to the specified version or buildstamp.." Changing to package dependencies with buildstamp "20090123-demo" ... begin workflow command (1/1) -> "runChangeDependencies -dispatch -buildstamp 20090123-demo -version 20090123-demo -resourcename .* -resourcetype [^\.]* " ... Request succeeded. end workflow command (1/1) -> "runChangeDependencies -dispatch -buildstamp 20090123-demo -version 20090123-demo -resourcename .* -resourcetype [^\.]* " [command.timer.demo.Mediator.stagingDukesBank.Change-Dependencies: 9.044 sec] Completed: Dependencies changed. execution time: 9.044 sec end workflow command (1/2) -> "Change-Dependencies -buildstamp 20090123-demo -resourcename .* -resourcetype [^\.]*" begin workflow command (2/2) -> "Deploy -buildstamp 20090123-demo -resourcename .* -resourcetype [^\.]*" ... Dispatching command 'Deploy' to objects: stagingDukesBank[Site] ... starting: stagingDukesBank[Site]->Deploy ... Dispatching command 'Deploy' to objects: stagingDukesBank[HsqldbRdb], stagingDukesBank[JBossServer] ... . . . . . . . . . end workflow command (1/1) -> "Docs-Generate " end workflow command (3/4) -> "Configure " begin workflow command (4/4) -> "Start " ... begin workflow command (1/1) -> "assertServiceIsUp " ... JBoss is not UP! Running handler command: startServiceWrapper Workflow beginning. commands: startService,waitforStartEvent begin workflow command (1/2) -> "startService " ... end workflow command (1/2) -> "startService " begin workflow command (2/2) -> "waitforStartEvent " ... end workflow command (2/2) -> "waitforStartEvent " [command.timer: 1:03.392 sec] Workflow completed. execution time: 1:03.392 sec end workflow command (1/1) -> "assertServiceIsUp " end workflow command (4/4) -> "Start " end workflow command (2/2) -> "Deploy -buildstamp 20090123-demo -resourcename .* -resourcetype [^\.]*" [command.timer.demo.Mediator.stagingDukesBank.Update: 4:36.961 sec] Completed: execution time: 4:36.961 sec
Verify change in staging
You can now navigate to the staging instance of Dukes Bank and verify that the same version of the application has been deployed: http://localhost:8280/bank/main (or your server's hostname)
If you go to the site list in Workbench's service manager tool, you'll see that the JBossDukesBank-20090123-demo.ear is now the current package dependency for stagingDukesBank.
You can also look at the package list in Workbench and see that the same packages are deployed to both development and staging.