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:
-
Click Environments.
-
Click Add + to add an environment.
-
In the dialog box, select Environment > Create New.
-
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. -
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.
-
Click + to add a new resource to the environment tier.
-
Click Add resources in the dialog box.
-
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. -
Click the Add tier () button in the upper right corner of the Environments Visual Editor to create a database tier.
-
In the new tier, click the Edit button () next to "Tier 1".
-
Change the tier name from the default (Tier 1) to "MariaDB" and click OK.
-
Click + to add a new resource to the MariaDB tier.
-
Click Add resources in the dialog box.
-
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. -
Go to the Applications List and click jpetstore-app to go to the Applications Visual Editor for this application.
-
Click the Add tier map () button in the upper right corner of the visual editor.
-
In the Tier Map dialog box, click Environment > jpetstore-test to select where the application will be deployed.
-
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. -
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. -
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.
-
Go to the Environments List and view the list of environments in the Environments tab.
-
Click Add + to add an environment.
-
In the dialog box, select Environment > Create from application > jpetstore-app.
-
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. -
In the App Server tier, click + to add a new resource to it.
-
Click Add resources in the dialog box.
-
Select jpetstore-test-wildfly in the resource list, and then click OK.
-
In the DB tier, click + to add a new resource to it.
-
Click Add resources in the dialog box.
-
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. -
Go to the Applications List and view the list of applications in the Applications tab.
-
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.