Deploying a Tomcat Application
In this lab, you will use a Service Catalog item to build out a Tomcat application model. You will then create a few environment models and map them to the application so that the Tomcat application can be deployed to those environments.
CloudBees CD/RO Application Models
CloudBees CD/RO makes deployments manageable, reproducible, and error-proof by modeling application tiers or microservices, modeling the deployment environments, and automating the workflow needed for the deployment. The model can be broken into these parts of your application tiers or microservice deployment.
- What: the files or microservices being deployed
- Where: the environments to which the application or microservices are deployed.
- How: the processes that orchestrate deployment of the application tiers or microservices to the environment.
You must have access to GitHub to complete this exercise.
Use the Tomcat Service Catalog item to create a model
- From GitHub, download jpetstore.war to your computer.
- Select the Service catalog link from the banner at the top.
- Navigate (scroll down) to the Tomcat Application Model Service Catalog item.
- Click the Create link and the Tomcat Application Model dialog appears.
- In the Application details section, enter these field values:
- Application Name: jpetstore
- Application Version: 1.0
- Application Project Name: Trial Guide
- Next, scroll down to the Artifact details section (you may need to expand it) and enter the following:
- Group Id: com.acme
- Artifact Key: jpetstore
- Version: 7.0.16
- Filename: jpetstore.war
- For File to upload: Click the Choose File button to upload the jpetstore.war file you downloaded earlier.
- Scroll down to the Deployment details section (you may need to expand it) and enter the following:
- Retrieve to Folder: /tmp
- Tomcat Config: Tomcat
- Context Path: jpetstore
- Click OK to generate the Application model. A “success” message is displayed and you are asked to navigate to the new Application model.
- Select Yes to navigate to the new application model.
Create the QA environment
In this exercise we will map a deployment environment to your Tomcat application model.
- Click the Requires Setup for the Map to environment menu item to open the Create Environment dialog.
- Select Create from this Application.
- Enter QA for the environment name and select the Trial Guide project you created earlier. Select OK to create the environment.
- Select the Resources plus (+) button.
- Select Add resources.
- Choose tomcat_mysql_qa then select OK.
- Return to the application by selecting the Application: jpetstore link in the Hierarchy Menu.
Deploy the application
- Select Run and then New Run. The Run Application dialog appears.
- Set Deploy as the process and QA as the environment, and turn off the Smart Deploy, Check Dependency and Artifact Staging options. Select OK.
- Once the application deployment completes click on the job details link.
- Next, on the Job Details page click on the link for the tomcat_mysql_qa Resource for the DeployApp step.
- Under the Resource Details find the Agent Host Name and copy the IP address.
- Use the IP address of the resource to access the application by appending
:8080/jpetsore
to the IP address that you copied. For example, http://35.202.90.57:8080/jpetstore/ - Close the Job Details dialog to return to the Deploy run.
- Navigate to the environment where the application was deployed by clicking QA in the breadcrumbs.
- Click on the Inventory link in the top navigation.
- Create a snapshot by clicking the snapshot (camera) icon under the Actions column and clicking the New Snapshot link.
- In the New Snapshot dialog enter jpetstore-qa* as the Name and then click the Next button.
- Click the OK button to save a new snapshot of this artifact.