Example: Deploy applications with provisioned cloud resources

3 minute readReferenceAutomation

The example in this topic consists of an application called "Hello World" application with one application process called Test1, which has two steps.

Hello World application
Figure 1. Hello World application

Test1 will be deployed in a dynamic environment called CloudEnv . You model the CloudEnv environment using the AWStest environment template.

Model the environment using a template
Figure 2. Model the environment using a template

The AWStest environment template has three tiers:

  • Tier 1 and Tier 3 have cloud resources defined in resource templates. These resource can be provisioned when you deploy the application.

  • Tier 2 has static resources, which cannot be provisioned.

    1. Open the CloudBees CD/RO Home page at https://<cloudbees-flow-server>/flow/.

    2. Enter your username and password and click Login.

    3. Go to the Applications List using one of the following methods:

      • Starting from the Main menu, click the Menu button, and then select Applications.

      • Starting from the Home page, click Applications.

        The Applications List opens.

        Application list
        Figure 3. Application list
    4. Choose an application, and click the Run process button for that application.

      Run the application
      Figure 4. Run the application
    5. Click New Run.

      The New dialog box to deploy the application opens.

      See the messages in this dialog box for hints about what you need to do to deploy the application.

      New run
      Figure 5. New run
    6. Select the application process to deploy.

    7. Click Map to Environment + to create a tier map for the application.

      The Tier Map dialog box opens.

      Create a tier map
      Figure 6. Create a tier map
    8. Select Environment Template.

      The Tier Map dialog box to select an environment tier opens.

      Select an environment tier
      Figure 7. Select an environment tier
    9. Select an environment template.

      The <Environment template>/Tier Map dialog box opens.

    10. For each application tier, click the Menu button to select an environment tier to which the application tier is mapped.

      Select environment tier to map
      Figure 8. Select environment tier to map
      Environment tier mapped to the application tier
      Figure 9. Environment tier mapped to the application tier
    11. Click OK.

      The New dialog box to deploy the application re-opens.

      Deploy the application
      Figure 10. Deploy the application
    12. Click Select Environment to select an environment template.

      A list of available environments and environment template based on the tier map opens.

      Environments and environment templates
      Figure 11. Environments and environment templates
    13. Select 1 Templates.

      A list of available environment templates appears.

      Environment templates
      Figure 12. Environment templates
    14. Click the environment template that you want to use.

    15. Enter a name for the dynamic environment that will be created from the selected environment template.

      The New dialog box to deploy the application now shows the environment template name below the application process name. It also shows the number of cloud resources provisioned in the environment templates.

      Enter dynamic environment name
      Figure 13. Enter dynamic environment name
    16. Click in the Cloud Resources row.

      The Cloud Resources dialog box opens.

      Cloud resources
      Figure 14. Cloud resources
    17. Change the number of cloud resources to provision

      In this example, Tier 1 and Tier 3 have one or more resources to provision because they have cloud resources. You cannot provision resources in Tier 2 because it has only static resources.

    18. Click OK.

      The New dialog box now shows the new number of resources to provision.

      The message "This application does not yet have an Environment to Run on" still appears.

      When you click OK, CloudBees CD/RO first attempts to create the dynamic environment. If this is successful, it deploys the application.

      New dialog
      Figure 15. New dialog

      The Applications List opens.

    19. To view the job details, click the View Details button to open to the Job Details page.

      CloudBees CD/RO first runs the job to create the dynamic environment. If this job is successful, it deploys the application.

      Application deployed
      Figure 16. Application deployed

      You can also see the status of jobs as they progress in the Applications List.

      This example shows the Application List when the job starts.

      Application list
      Figure 17. Application list

      If you provision resources that are not available, such as 20 cloud resources in Tier 1 and 3 static resources in Tier 2, the job to create the dynamic environment fails and the application is not deployed.