Page tree
Skip to end of metadata
Go to start of metadata

This topic walks you through the process of configuring and deploying a sample application in BMC Release Process Management (RPM). The walkthrough includes the following sections:

Introduction to this walkthrough

This walkthrough is an exercise that you can perform to understand how RPM and some of its functionality works. The steps include the building blocks of how to create an application and environments with components where you will run automation scripts that you can download in this walkthrough.

First, you will create and configure an application according to the following steps:

Then, you will deploy the configured application on one of the environments:

What do I need to do before I get started

This example assumes that you have two servers:

On the Windows source server, do the following:

  • Download and save the configuration.zip file containing the show_processes script that is required for the walkthrough. The file location in the walkthrough is C:\BMC\DEV.
  • Download and save the SH_unzip and SH_runcommand scripts.
  • Log in to RPM as administrator—the default superuser.

Key terminology

Application. An application represents the software unit necessary for the deployment process. It comprises various components that are mapped to different environments.

Environment. An environment represents a set of servers grouped together for a particular purpose in the deployment process. Environments can be of various types depending on the purpose for which they are created. For example, development environment, QA environment, staging environment, production environment, and so on. With the help of the environment types, environments are mapped to the deployment stages.

Component. Components form pieces of an application and are assigned to various environments for deployment.

Request. A request is the main unit of deployment in RPM. It represents the mechanism used to deploy one or many components of an application into an environment. Requests contain different tasks related to the deployment process. They are comprised of steps, which can be manual (for example, check logs for errors) or automated (for example, deploy package using one of the automation scripts). Requests and steps can be assigned to users and scheduled in the calendar. Requests follow a series of states and transitions from created to complete.

Property. Each step in a request can determine which servers and components are affected during the execution. Steps can also draw properties assigned to those components. Properties are the place to store settings data and values that are important to the execution of requests. When you put values such as “classpath” in properties, the same value is mapped to each request working with those components in those environments. Properties can have property values (default values), installed components, application components, requests, servers, and server levels.

For more information, go to Managing configuration of applications, topology, and infrastructure and Managing and optimizing the application release workflow.

How do I configure an application in RPM

In this walkthrough, you will configure a sample application with several environments and components. To configure an application, you need to do the following:

Create a user

 StepExample screen (click the image to expand)
1

Create an operational group of users that will be assigned to the application.

  1. In the console, go to System > Groups and then, on the right side of your screen, click Create Group.
  2. In the Name box, enter Operations.
  3. In Roles, click Add Role, and then select Coordinator Admin and User roles.
    Note: For more information about RPM user roles, see Managing user roles.
  4. Click Create.
2

Create a user and add the user to the Operations group.

  1. Go to the Users subtab, and then, on the right side of your screen, click Add New User.
  2. Enter the first and last names, email address, login name, and password for the user.
  3. In Groups, click Add Group, and then select the Operations group.
  4. Click Create User.
3

Add a group to the team.

  1. Go to the Teams subtab, and then, on the right side of your screen, click Create Team.
  2. In the Team Name box, enter Retail Online.
  3. On the Add Group to Team bottom tab, select the Operations group.
  4. Click Create Team.

Back to top

Create an application

 StepExample screen (click the image to expand)
1

Create the JPetStore application with the Retail Online team.

  1. In the console, go to the Applications tab, and then, on the right side of your screen, click Create Application.
  2. In the Name box, enter JPetStore.
  3. In the Team box, select Retail Online.
  4. Click Create.

2

Add DEV, SIT, UAT, and PROD environments to the JPetStore application.

  1. Click add/remove environments.
  2. Click create new environment, and then, in the new box, enter the name of the environment.
  3. Repeat step 2 for all the needed environments.
  4. Click Save.

Configure application environments

 StepExample screen (click the image to expand)
1

Now that the required environments are created and added to the JPetStore application, add the General, AppServer, and Database components to the application.

  1. Click add/remove components.
  2. In the Add/Remove Components dialog box, click create new component, and then, in the new box, enter the name of the component.
  3. Repeat step 2 for all the needed components.
  4. Click Save.
2

After you added the components, click Copy All Components to All Environments to associate the components with environments.

3

Define the types of the DEV, SIT, UAT, and PROD environments.

  1. In the console, go to Environment > Environments.
  2. Next to the DEV environment, click Edit.
  3. In the Environment type list, select Development.
  4. Click Update.
  5. Repeat steps 24 for the SIT (the Testing type), UAT (the Testing type), and PROD (the Production type) environments.

Back to top

Create a target server for deployment

 StepExample screen (click the image to expand)
1

Create a server that will be used for deployment of the JPetStore application. In this walkthrough, the target server IP is 10.128.36.152, it is running on the Linux OS and is using the NSH agent.

  1. In the console, go to Environment > Servers, and then, on the right side of your screen, click Create Server.
  2. Enter the following information for the server:

    1. In the Name box, enter a unique name for the server, for example, 152-test.corp.net.
    2. In the DNS/URL box, enter the Domain Name System (DNS) or Uniform Resource Locator (URL) for accessing the server, for example, 10.128.36.152.
    3. In the IP address box, enter the IP address of the server, for example, 10.128.36.152.
    4. In the OS Type list, select the operating system on which the target server runs: Linux.
    5. In the Agent Type list, select the appropriate agent type that is used by the server: NSH.
  3. In Environments, select the environments that you want to associate with the server: DEV.
  4. Click Create.

2

Add the 152-test.corp.net server to the JPetStore application.

  1. On the Applications tab, open the JPetStore application.
  2. Expand the DEV environment, and then select components that will use the target server: AppServer and Database.
  3. Click add/remove servers.
  4. In the opened dialog box, in Server Associations to Add, select 152-test.corp.net, and then click Update.

Set up component properties

Create the SSH_USER and SSH_PASSWORD properties for the AppServer and Database components. These properties will be used to connect to the 152-test.corp.net server that runs on Linux.

 StepExample screen (click the image to expand)
1

Create the SSH_USER property.

  1. In the console, go to Environment > Properties.
  2. On the right side of your screen, click Create Property.
  3. In the Name box, enter SSH_USER.

  4. In the Default value box, enter root.
  5. To assign a property to the component, next to Component Assignment, select AppServer and Database.

  6. Click Create.
2

Create the SSH_Password property.

  1. Click Create Property.
  2. In the Name box, enter SSH_PASSWORD.
  3. In the Default value box, enter the password that will be used to log in to the target server.
  4. To hide the property value, select the Private check box.
  5. To assign a property to a component, next to Component Assignment, select AppServer.

    Tip: When you assign a property to a component, the property is applied to all servers in the component. If a user name and password are only specific to a single server, you can assign a property at the server level.

  6. Click Create.

Back to top

How do I deploy an application in RPM

In this walkthrough, to deploy the application, do the following:

Prepare automation for a request

In this part of walkthrough, you will import two default Remote Dispatcher scripts for running automation on the target server and create two Remote Shell automation scripts (see What do I need to do before I get started).

 StepExample screen (click the image to expand)
1

Enable automation.

  1. In the console, go to System > Settings > General.
  2. In the Module - Automation section, select the Enable Automation check box, and then click Save.

2

Import the default Remote Dispatcher scripts.

  1. Go to Environment > Automation.
  2. On the right pane, click Import scripts from Library.
  3. In the Import automations scripts from Library dialog box:
    1. In the To use as list, select Remote Dispatcher.
    2. In the Agent Type list, select the agent type used by the target server: NSH.
    3. In the table below, select dispatch_file_put.rb and dispatch_script_run.rb.
    4. Click Import.
3

Create the SH_unzip script for unzipping a file.

  1. Go to Environment > Automation and, on the right side of your screen, click Create Automation.
  2. In the To use as list, select Remote Shell.
  3. In the Choose Automation Category list, select Remote Script Run.
  4. In the Script Name box, enter SH_unzip.
  5. In the OS Types list, select Linux as the target server is running on Linux.
  6. In Script body, type the contents of the SH_unzip.sh file.

    Note: To avoid any hidden characters, do not copy and paste the script.

  7. Click Add script.
4

Create the SH_runcommand script for executing commands on the target server.

  1. Go to Environment > Automation, and then, on the right side of your screen, click Create Automation.
  2. In the To use as list, select Remote Shell.
  3. In the Choose Automation Category list, select Remote Script Run.
  4. In the Script Name box, enter SH_runcommand.
  5. In the OS Types list, select Linux.
  6. In Script body, type the contents of the SH_runcommand.sh file.

    Note: To avoid any hidden characters, do not copy and paste the script.

  7. Click Add script.
5

Change the status of the created scripts. For more information, see Using status of objects.

In the Automation table, next to the SH_runcommand and SH_unzip script, in the Actions column, click Pending, and then Released.

Back to top

Create and start a request

 StepExample screen (click the image to expand)
1

Create a request.

  1. In the console, click the Requests tab, and then, on the right side of your screen, click Create Request.

  2. Under Core Attributes, in the Name box, enter Deploy JPetStore.
  3. In the Requestor list, select Brian Davis as the user who creates the request.
  4. In the Owner list, select Brian Davis as the user who is assigned to the request.
  5. In the Application list, select JPetStore.
  6. In the Environment list, select DEV.
  7. Click Create Request.

2

Add an automation step that will copy the configuration.zip file from the source server on which RPM is running to the tmp directory on the target server.

  1. In the Steps section, click New Step.
  2. In the New Step 1 dialog box:
    1. In the Name box, enter Copy a file.
    2. In the Owner list, select Brian Davis.
    3. In the Component list, select AppServer.
    4. On the Automation tab, in the Step Action list, select Remote File Put.
    5. In the Source host box, enter localhost as the file is located on the RPM server.
    6. In the Source path box, enter the path to the configuration.zip file, for example, /C/BMC/DEV/configuration.zip.
    7. In the Target path box, the default value for the Remote File Put script is /tmp, so leave the box empty.
  3. Click Add Step & Continue.


3

Add an automation step that will unzip the configuration.zip file on the target server.

  1. In the New Step 2 dialog box:
    1. In the Name box, enter Unzip a file.
    2. In the Owner list, select Brian Davis.
    3. In the Component list, select AppServer.
    4. On the Automation tab, in the Step Action list, select Remote Script Run.
    5. In the Task list, select SH_unzip.
    6. In the Path to file box, enter /tmp/configuration.zip.
    7. In the Target path box, enter /tmp.
  2. Click Add Step & Continue.

4

Add an automation step that will check if the required files are successfully unzipped on the target server.

  1. In the New Step 3 dialog box:
    1. In the Name box, enter Verify copy.
    2. In the Owner list, select Brian Davis.
    3. In the Component list, select AppServer.
    4. On the Automation tab, in the Step Action list, select Remote Script Run.
    5. In the Task list, select SH_runcommand.
    6. In the Command to exercise box, enter ls -l.
    7. In the Target path box, enter /tmp.
  2. Click Add Step & Continue.
5

Add an automation step that will make the show_processes.sh file executable.

  1. In the New Step 4 dialog box:
    1. In the Name box, enter Set permissions.
    2. In the Owner list, select Brian Davis.
    3. In the Component list, select AppServer.
    4. On the Automation tab, in the Step Action list, select Remote script run.
    5. In the Task list, select SH_runcommand.
    6. In the Command to execute box, enter chmod +x show_processes.sh.
    7. In the Target path box, enter /tmp.
  2. Click Add Step & Continue.
6

Add an automation step that will execute the show_processes script from the configuration.zip file.

  1. In the New Step 5 dialog box:
    1. In the Name box, enter Execute script.
    2. In the Owner list, select Brian Davis.
    3. In the Component list, select AppServer.
    4. On the Automation tab, in the Step Action list, select Remote script run.
    5. In the Task list, select SH_runcommand.
    6. In the Command to exercise box, enter /tmp/show_processes.sh.
  2. Click Add Step & Close.
7On the right side of your screen, click Plan Request, and then Start Request.

Back to top

View automation results

After the request is complete, you can view the results of the automation steps.

 StepExample screen (click the image to expand)
1

Click the Copy a file step, and then go to the Notes tab.

The configuration.zip file is successfully copied to the target server.

2

Click the Unzip a file step and go to the Notes tab.

The configuration.zip file is successfully unzipped to the tmp directory on the target server. The archive contains several random files and the show_processes.sh script that is executed in the Execute script step.

3

Click the Verify copy step, and then go to the Notes tab.

The executed ls -l command lists the contents of the tmp directory and you can verify if all the required files are unzipped successfully.

4

Click the Set permissions step, and then go to the Notes tab.

The show_processes.sh script is made executable.

5

Click the Execute script step, and then go to the Notes tab.

The show_processes.sh script is executed successfully, and current processes that run on the target server are shown.

Back to top

Troubleshooting

 StepExample screen (click the image to expand)
 

In case, you start the request and some steps get the Problem status, do the following:

  1. In the console, on the right side of your screen, click Hold Request.
  2. Click the step with the Problem status, go to the Notes tab, and view the error message.
  3. Make the necessary edits, and then rerun the request.

Wrapping it up

In this walkthrough, you went through the process of creating a RPM user who was assigned to the application with certain environments and components. You ran automation scripts that copied a zip file from one server to another, unzipped it, and ran a script from the zip file on the target server.

Where to go from here

Check out Managing automation to see how you can optimize the process of application deployment using different script types and Managing plans to organize the process of deployment more efficiently. Also, you can check End-to-end process.

 

  • No labels