Basics 3 - Environment Modeling

Article ID:360032823252
4 minute readKnowledge base

In this module, you will learn how to create a new environment from scratch the following ways:

  • Modeling a new environment containing two tiers and at least one resource in each tier.

  • Creating an environment based on an existing application.

The steps below describe how to model environments as demonstrated in the video. You can perform these steps to model environments using your resources. The resources in the video are just examples and do not exist in the latest appliance.

Creating a New Environment From Scratch

Starting from the Home page:

  1. Click Environments.

  2. Click Add + to add an environment.

  3. In the dialog box, select Environment > Create New.

  4. Enter "jpetstore-test" as the environment name in the dialog box, and click OK .
    An environment can have multiple tiers.
    In this tutorial, we will create two tiers — an application tier and a database tier.
    Let’s start by creating an environment for an application.

  5. In the Environment Visual Editor, click the Edit button () next to "Tier 1", change the tier name from the default (Tier 1) to "Wildfly" and click OK.

  6. Click + to add a new resource to the environment tier.

  7. Click Add resources in the dialog box.

  8. Select "petstore-test-wildfly" in the resource list, and then click OK .
    An environment tier can have multiple resources.
    We will be adding two to the database tier.

  9. Click the Add tier () button in the upper right corner of the Environments Visual Editor to create a database tier.

  10. In the new tier, click the Edit button () next to "Tier 1".

  11. Change the tier name from the default (Tier 1) to "MariaDB" and click OK.

  12. Click + to add a new resource to the MariaDB tier.

  13. Click Add resources in the dialog box.

  14. Select "jpetstore-test-db" and "jpetstore-test-db-backup" in the resource list, and then click OK .
    The environment is now ready!
    However, to deploy to this environment, an application needs to be mapped to it.

  15. Go to the Applications List and click jpetstore-app to go to the Applications Visual Editor for this application.

  16. Click the Add tier map () button in the upper right corner of the visual editor.

  17. In the Tier Map dialog box, click Environment > jpetstore-test to select where the application will be deployed.

  18. In the DB application tier row, click the Menu button () and select the MariaDB environment tier.
    A green check mark appears in the row when the mapping is successful.

  19. In the App Server application tier row, click the Menu button () and select the Wildfly environment tier.
    A green check mark appears in the row when the mapping is successful.

  20. Click OK .

    The jpetstore-app application is now ready to be deployed to the jpetstore-test environment.

    If an environment tier has multiple resources, the processes in the application tier mapped to the environment tier are executed on those resources.

Creating an Environment Based on an Application in CloudBees CD (CloudBees Flow)

Instead of creating an environment from scratch, you can also create an environment that corresponds to an existing application authored in CloudBees CD (CloudBees Flow). The new environment is a copy of the environment to which the application is mapped, which you do not need to create it from scratch. CloudBees CD (CloudBees Flow) automatically maps the new environment to the existing application.

  1. Go to the Environments List and view the list of environments in the Environments tab.

  2. Click Add + to add an environment.

  3. In the dialog box, select Environment > Create from application > jpetstore-app.

  4. Enter "jpetstore-dev" as the environment name and click OK in the dialog box.
    The jpetstore-dev environment is a copy of the environment to which the jpetstore-app application is already mapped.

  5. In the App Server tier, click + to add a new resource to it.

  6. Click Add resources in the dialog box.

  7. Select jpetstore-test-wildfly in the resource list, and then click OK.

  8. In the DB tier, click + to add a new resource to it.

  9. Click Add resources in the dialog box.

  10. Select jpetstore-dev-lib in the resource list, and then click OK .
    The jpetstore-dev environment is automatically mapped to the application on which it was modeled.

  11. Go to the Applications List and view the list of applications in the Applications tab.

  12. Click the down arrow in "Map 3" in the upper right corner in the Applications Visual Editor and select jpetstore-dev .
    This tier map opens and shows the following:

    • The DB application tier is mapped to the DB environment tier.

    • The App Server application tier is mapped to the App Server environment tier.

You have now authored an environment in CloudBees CD (CloudBees Flow)!

If you have resources in the cloud, CloudBees CD (CloudBees Flow) supports the modeling of dynamic environments too. It provides resource templates and environment templates to create them.

Summary

Environments can be modeled in CloudBees CD (CloudBees Flow) one of these ways:

  • Defined from scratch.

  • Derived from the structure of an existing application.

  • Defined with dynamic resources.

What’s next

Create and run more application deployments.

To learn more, go to learn.electric-cloud.com.