Monday May 26, 2008

Deployment Management

During the normal development cycle using Java CAPS, when you perform a build, it uses the latest version of your component. Even if that particular component is not checked in.

This is fine during your first development cycle, but what happens once you have code in production?
If changes are made to the implementation, and all of a sudden, a new build of production is required, the new code changes are implemented even though they may not be stable or tested.

This topic will discuss methods to manage your deployments so that this case will not happen.


I'm going to go through 3 methods of versioning your deployments.

Note : In the interests of paranoia, its best to export and backup your project before performing the following tasks.

Tagging Versions


Version tagging allows you to specify specific builds of components. Rather than having to deal with individual version numbers and trying to figure out which version belongs to which build, simply "Tag" the version.

1) If not already done so, check in all components (or the component in question).



2) Right click the component or the highest node and select "Version Control" then "Tag"


3) You will then be able to give this version a "Tag" to identify the version.



If you do this at a high node level, all current versions inherit the tag.

Change your tag name to something more meaningful.

4) Open up your deployment profile and change it to "Spreadsheet View"




5) For each required component, select the appropriate "Tag".



Now, when you build your project, only the versions that are "Tagged" will be used.


Snapshots


Snapshots allow you to take a "backup" of your current deployment profile for re-building at a later date.

1) First make sure that all components related to the deployment profile are checked in. This is important as anything not checked in will be lost.
2) At the bottom of the screen, you will see 2 buttons. Global Settings and Snapshot.
Global Settings allows you to select a particular snapshot for deployment, or use the latest versions.
Snapshot - takes a snapshot of the current deployment profile.



3) Click Snapshot to take a snapshot of your now modified (tagged) deployment profile) and give it a meaningful name.


4) Click the "Global Settings Button"


By default, the latest Repository versions are used. We want to use a snapshot, so select "User Specific Snapshot" and select the snapshot you just took.


Press OK and OK again at the Warning screen.

What you will see is that all versions within the snapshot are brought to view.

5) Now when you build your project, your snapshot versions will be used.

To go back to the latest versions, simply select Global Settings and "Use Latest Repository Versions"


Build Version Control

The final method of versioning your deployments is to simply take a copy of your build.

Firstly, we need to find where your build files are created.

1) At the top of Enterprise Designer, select Tools/Options.


2) Select the Build Options tab and take note of the Target EAR Build Path.



3) Now using Windows Explorer, navigate to the path you noted down. Keep drilling down the directory tree and eventually you will find an .ear file. This is your build.

Take a copy of this file and keep it in a safe place. This could be in a separate directory structure or within a version control system such as subversion or cvs.

To Run a previous build, you need to first go into the Enterprise Manager. For example, in Internet Explorer, go to http://localhost:15000 depending on the port you installed it on.


4) In the Enterprise Manager, click the "Deployer".



5) Click the Deploy Application Tab in the workspace window.


6) Click browse and navigate to where you have stored your .ear file.

7) Click the Check Boxes for "Deploy" and/Or "Enable" to enable the project.

8) Click the deploy button. Your previous version is now deployed.





Comments:

Post a Comment:
  • HTML Syntax: NOT allowed