IBM UrbanCode provides a suite of tools to handle the build, release, and deployment phases of larger DevOps cycles. UrbanCode Deploy handles automating application deployments. It provides continuous delivery during agile development, and the auditing trails, version support, and approval trails needed in production. Part 1 of this pair of articles describes how to set up the deployment of a single Liberty server.
Before you start, access the IBM UrbanCode Deploy Documentation in the IBM Knowledge Center to install and set up your UrbanCode Deploy environment.
- I used UrbanCode Deploy 18.104.22.168 but the instructions apply to later versions as well.
- Be aware that you will need access to a Rational Common License server to complete the install.
- Install the UrbanCode Deploy Liberty plug-in which is an add-on to the base UrbanCode Deploy Server.
The order in which I walk through the UCD object creation differs slightly from the recommended path:
Application → Components → Resources/agents → Environments
This is so that you can test a component process in isolation once the component is added to the application. This eliminates the need to create an application process before testing a component.
This also allows me the option of grouping any properties that can be re-used across components under the application property section.
The order recommended by the UrbanCode Deploy tutorial documentation is to create the components before the application.
1. Creating the UrbanCode Deploy Liberty application
An UrbanCode Deploy application is the collection of the components needed for automated deployment. Artifacts are the application files need for installation and components encapsulate the artifacts needed to install an application.
Create the Liberty application on the UrbanCode Deploy dashboard:
- Click Create New Application and give the application a name, such as
Liberty Profile Application:
liberty_directory, which resolves to the Liberty profile installation directory.
liberty_jar_name, which resolves to the name of the installation JAR file.
liberty_profile_directory, which resolves to the location of the Liberty profile server directory.
liberty_serverName, which resolves to the name of the Liberty profile server.
liberty_root, which resolves to the Liberty profile installation root directory.
Most of the properties used in the Liberty component process design are defined under Liberty Profile Application > Configuration > Application Properties. The same property can have different values by doing a re-declaration at the component, environment, and/or resource level. The property value is resolved based on object precedence.
There are exceptions: for example; properties referenced in the component ‘basic setting’ panel did not resolve when only declared in the application property section. I added the following property in the component properties section.
liberty_install_resp, which resolves to the installation location of Liberty Repository.
See Using properties in the Knowledge Center.
You have now created an application called Liberty Profile Application. In the next section you will create a component in the application called Liberty Component.
2. Creating an UrbanCode Deploy Liberty component
A component is the primary container for artifacts needed for the installation of the application. In this article, the Liberty Profile Installation file is the artifact.
- Click Create New Component and give the component the name
2. Set Source Config Type to
File System (Versioned) (see (1) in the figure below). This is where UrbanCode Deploy will retrieve the artifacts from. Other sources such as Subversion and Maven are also supported.
3. In the Base Path field, type the name of the
liberty_install_resp property (see (2)). This field does not auto-complete so ensure you enter the name in the correct format (see Using properties).
4. Select the Import Versions Automatically check box (see (3)). This makes UrbanCode Deploy poll for new artifact versions to manage.
5. Select the Copy to Code Station check box (see (4)). This imports artifacts into the UrbanCode Deploy code station. The amount of data in code station can become an issue so you can configure the lifecycle of artifacts in code station in the Settings view.
6. Select the Run process after creating a new version check box (see (5)). This triggers UrbanCode Deploy application processes.
You have now created a component for the Liberty Profile Installation file by filling in basic component information. Next you must create the set of component processes needed to act on the Liberty Profile artifact.
3. Creating the component process
- Create a new component process with the name
Liberty Profile Install.
- Set the Process Type to
Deploymentand the Inventory Status to
- During deployment automation execution, the target system’s local UrbanCode Deploy agent creates a default working directory with the component name. The targent system’s local agent will download and store the component artifact in this default directory. By default UrbanCode Deploy sets a server property as a references to the component’s Default Working Directory value. You can reference the same server property in your process design. Notice the Default Working Directory field is set by default.
You have now created the component process.
4. Creating the process design
We will now create the Liberty Profile Install process design for the Liberty Profile component with the following steps:
- Stop the previously running Liberty Profile (see (1) in the figure below).
- Delete the previous Liberty Profile installation (see (2)).
- Download the Liberty Install artifact to a component default working directory on the target system (see (3)).
- Install Liberty profile (see (4)).
- Create the Liberty profile server (see (5)).
TIP: Create component processes as though the target systems already have an active deployment; in this example, Liberty Profile. Processing optionally continues past steps 1 and 2 if the server is not running or installed.
All of the following steps for the process design are available in the UrbanCode Deploy Liberty plug-in. You just need to add them to the design and configure certain settings.
- Add the Liberty Profile Stop Server step to the process design:
- In the Server Name field, type the name of the application property
liberty_serverName(see (1) in the figure above). Manage component and application properties from the Configuration panel (see also Using properties).
- In the WebSphere Liberty Installation Directory field, type the name of the application property
- Select the Allow Failure field (see 3). This means that processing can continue if the Liberty server is stopped or not deployed.
- Leave the Working Directory field empty; it defaults to previously discussed Default Working Directory. UrbanCode Deploy creates a working directory with the name of the component. You can optionally reference the component’s default working directory as
- In the Server Name field, type the name of the application property
- Add the Liberty Profile Delete Files and Directories step to the process design:
- Set Working Directory to the installed Liberty server location.
- Set Base Directory to the current working directory.
- Enable the Allow Failure option.
When you change the working directory path, remember to review the Base Directory and Working Directory values. The base directory value is appended to the working directory value during process execution.
- Add the Download Artifacts step to the process design:
- Accept the default settings this design step.
- Add the Liberty Profile Install Server Archive step to the process design:
- Add the Liberty Profile Create Server step to the process design.
I also defined other Liberty Profile component processes to be used with Liberty Profile application processes. The Liberty plug-in support was useful in designing the following component processes:
Component Process Design: Uninstall Liberty Server
Component Process Design: Start Liberty Server
Component Process Design: Stop Liberty Server
5. Integrating the component into the Liberty Profile application
With the Liberty Profile component processes created, you need to associate the component with the Liberty Profile application. In the application, click Add Component and select the component name:
6. Creating Resources for the Liberty Profile application
Resources are generally the UrbanCode Deploy application deployment targets; a server, for example. Any systems with UrbanCode Deploy agents installed will show up in the Resources > Agents panel of the administration dashboard. Include agents in new or existing top-level group declarations to make them available for application deployments.
- Create a top-level group called
Liberty Windows Group.
- Add any target deployment system agents to the group.
- Add the component to an agent in the Resource view:
7. Creating an application environment
- With the resources in place, create an application environment for
To complete creating the environment, add a top-level group resource:
8. Creating processes for the Liberty Profile application
With component, resource, and environment declared, the Liberty Profile application needs processes to manage the component process execution.
Create an application process:
1. Click Create New Process.
3. In the Inventory Management field, select Automatic.
4. In the Offline Agent Handling field, select Check Before Execution.
5. Add a Liberty Profile component > Liberty Profile Install step to the new application process design.
8. Running the deployment process
You’re now ready to run the deployment automation:
- Click the Request Process button next to the Environment definition to start the deployment:
Clear the Only Changed Versions check box to force the overlay of previous deployments. This is useful for deployment automation testing:
The submitted process automation displays in an execution panel:
The completed process request:
And that completes a single Liberty deployment.
If you want to deploy across more servers, add additional agents to a new or existing top-level group resource. Applications deploy across multiple resources by adding them to an existing or new environment. Creating additional UrbanCode Deploy environments is another way to group systems and control deployments because environments are a specified option in running the application process.
In Part 2, we install a simple server application with the Liberty deployment.