Unsupported content

   

This version of the documentation is no longer supported. However, the documentation is available for your convenience. You will not be able to leave comments.

Using properties to deploy multiple versions of an application to the same server

Some organizations install multiple versions of the same application on one server. For example, an organization might install different versions of Oracle for Development, QA, and Production on the same server. Each version resides in a different location on that server.

To manage situations like this, organizations typically set up each instance of an application as a component. You can define a Deploy Job that applies changes to all of these applications because one job can be targeted at multiple components.

Setting up your system to deploy to multiple components involves many areas of functionality in BMC Server Automation. The following example provides a generalized description of how to set up a component template, discover components, and then deploy a BLPackage to all of those components.

This example shows how to deploy a configuration file to three instances of an application at the following locations:

D:\app1
D:\app2
D:\app3

To use properties when deploying multiple version of an application to the same server

  1. Create a component template that encapsulates the application. To accomplish this, do the following:
    1. Use the Component Template wizard to create a component template. On the General panel of the wizard, check the Deploy option so you can deploy objects to any components based on this component template.
      For more information, see Creating a component template.
    2. In the component template, create a local property that can be used to define the path to each instance of the application.
      For example, the property might be called TPL_APP_PATH.
    3. For that local property, create three property instances. For one, define the TPL_APP_PATH property so it equals app1. For another, it should equal app2. The third should equal app3.
      For more information about local properties for component templates and property instances, see Local properties for a component template.
    4. On the Parts panel of the Component Template wizard, add the configuration file you want to deploy by clicking Add Part . The Select Parts dialog box opens. On that dialog box, click Add New, which opens the New Component Template Part dialog box. On that dialog box, for Type, select File. Then enter the path to the configuration file. For the portion of that path that varies for each application, insert a parameter referencing the TPL_APP_PATH property.
      For example, the path to the file might be D:\\??TPL_APP_PATH??\config.
    5. Create a signature for the component template. The only requirement for the signature is that the configuration file you added in step D must exist.
      For more on creating signatures, see Discover tab for a component template.
    6. Save the component template.
  2. Run a Component Discovery Job on the server on which the three instances of the application are installed.
    Using the criteria in the component template, the job should discover three components that match the signature.
    For more information, see Creating and modifying Component Discovery Jobs.
  3. Create a BLPackage called app_configuration that contains the configuration file you want to deploy. To accomplish this, do the following:
    1. Add the configuration file to the Depot as a BLPackage called app_configuration.
    2. Open the BLPackage for editing.
    3. Create a local property for the BLPackage called PKG_APP_PATH. Make sure that the type of property is the same as the type of the local property you created for the component template.
      For example, if that property was a String type, then this property should also be a String type.
    4. Edit the path indicating where the configuration file added in step A should be deployed. Replace the root directory for the application with a parameter referencing the PKG_APP_PATH property.
      For example, if you wanted to deploy the file to D:\app1\config, you would enter a path like D:\\??PKG_APP_PATH?\config.
    5. Save the BLPackage.
      For more on creating BLPackages, see Adding a BLPackage to the Depot.
  4. Create a Deploy Job  to deploy the app_configuration BLPackage that you created. To accomplish this, do the following:
    1. Open a BLPackage Deploy Job.
    2. On the Package panel, specify the BLPackage being deployed as app_configuration.
    3. For the PKG_APP_PATH local property, specify that you want to set a value for a component property name by setting the Assignment Type column to Component Property Name. Then, for the Name/Value column, set the value to TPL_APP_PATH.
    4. When specifying targets, choose the components to which you want to deploy.
    5. Execute the Deploy Job.
      When you deploy, the value of TPL_APP_PATH that was defined for each component and was in turn derived from the value of the local property instances you created in step 1 replaces the value of PKG_APP_PATH. For example, TPL_APP_PATH resolves to D:\app1 for the first instance of the application. That replaces the value of PKG_APP_PATH, which allows the configuration file to be successfully deployed to a path of D:\app1\config.
Was this page helpful? Yes No Submitting... Thank you

Comments