UrbanCode Deploy: A sample process to create Base Websphere profiles

Following up my last post, I describe a simple sample UCD process that helps with automating the creation of Base WebSphere profiles. I hope to attack setting up WebSphere ND infrastructure at some later time.  As with the previous post the intent is not to create a “perfect” process but one that gets the job done while exploring  some other aspects of UCD.

First I set up some process properties that are used to parametrize some of the options to the WebSphere manageprofiles command.

processpropsThe Label for each property describes it’s purpose so I won’t bother rehashing them here. I have tried to ensure that some of the properties are given valid values by using regular expression patterns to validate them. The WAStemplateType property offers a (hard-coded) choice of valid profile template types – default or management in this case. The enableAdminSecurity property is a check box that will be used to determine whether Administrative Security is to be enabled for the new profile.

Here is the process design to create a profile.

createbaseprofileprocess

a) checkProfileNameWPath : This is a Scripting -> Shell -> Shell step that runs the following command:

manageprofiles -getName -profilePath ${profilePath}\${WASProfileName}

This will try to get the WAS profile name from the path specified via the profilePath option. If it succeeds (exit code == 0) then the assumption is that a profile already exists at the specified path, so I use a post-processing script to set the step’s status to “Failure” and stop the process:

setProfilePathStatus

b) checkProfilePathWName: This is almost a duplicate of the previous step that runs the following command:

manageprofiles -getPath -profileName ${p:WASProfileName}

I want to be doubly sure that the profile does not already exist so this reverses the previous step and try to get the WAS path given the profile name specified via the profileName option. As before if it succeeds (exit code == 0) then the assumption is that a profile already exists with the specified name, so I use the same post-processing script to set the step’s status to “Failure” and stop the process.

c) enableAdminSecurity?: This is a use of UCD’s topicSwitch steps and conditional processes capability. It checks the value of the enableAdminSecurity property and branches to the appropriate step.

d) createProfileWithSecurity and createProfileWithoutSecurity : These are Shell steps that run the manageprofiles -create command with or without the enableAdminSecurity  option.

manageprofiles -create  -templatePath ${p:WAStemplateDir}\${p:WAStemplateType} -profileName ${p:WASProfileName} -profilePath ${p:profilePath}\${p:WASProfileName} -enableAdminSecurity true -adminUserName ${p:adminUserName} -adminPassword

e) runIVT: The profile creation step may succeed but to make sure it did, this step runs the ivt command as a final check. Note that I need to change the Working Directory property of this step to be the newly created profile’s bin directory.

So there it is: a fairly simple UCD process to create Base WebSphere profiles. There are probably many other, possibly more robust, ways to implement the failure processing done in steps (a), (b) and (e). In addition it should be possible to construct the variants of the manageprofiles create command without using the switch, but this looks better at least:-)

Advertisements

2 thoughts on “UrbanCode Deploy: A sample process to create Base Websphere profiles”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s