A simple project to install Tomcat binaries on a target
Project overview.
.
Here is a summary of what this project wil achieve.
- This project will deploy Tomcat 7 binaries onto a target server.
- It will copy a tomcat-users.xml onto the target and then start the Tomcat server.
- Please note in addition to the Tomcat7 plugin there are also plugins to install Tomcat 8 and 9 versions.
- This project is configured for use on Linux/Mac only.
What is preconfigured and demonstrated.
The project demonstrates the following configurations:
- Target servers for Linux/Mac using localhost
- Use of the Remote agent plugin
- Use of external resources to download Tomcat binaries from the internet
- Use of a product environment
- Copy task
- StartTomcatTask
- TomcatBinaryInstallTask
- Use of built in variables such as ${ARCHIVE_ROOT}
How to use this project.
- Download the project to your desktop by clicking on one of the links. The file will be saved as Tomcat-7-Install-41.zip
- Log into your RapidDeploy instance as mvadmin.
- Navigate to Resources-> Projects.
- In the top right hand corner click on the Upload Project button.
- Select the zip file you downloaded in step 1.
- You are guided through a project import wizard. The important thing to check and change (if necessary) here is the path to the project storage directory. Ideally this should be under the projects directory in your RapidDeploy installation. E.g.
-
/usr/midvision/projects/Tomcat-7-Install-41
-
- Once the project has been imported, we need to amend the deployable installer. Apache regularly update their releases. For this reason you will need to check and amend the release URL.
- Navigate to Resources -> Libraries .
- Click on the Tomcat-7-Binary-Install-Package resource and then click the Open button.
- Check the HTTP File URL is correct and amend for your version of Tomcat. You can get the latest version 7 links from here, and version 9 download links from here.
- Once updated, click on the Check Resource button in the bottom right corner to check connectivity to the resource.
- Save the library.
- Once the project is imported and required resource selected, you’ll need to create a package to deploy.
- Firstly, navigate to Resources-> Projects and edit the project (pencil icon on the tool menu).
- Navigate to the Packages tab and click the Create Package button. A new package is created with a version number. This is the package you’ll deploy later, containing all the environment definitions, actions and payload (scripts) to allow the jobs to be run on all defined servers. It might take a while to see the package in this panel as package creation triggers the download of external resources into the package and, depending on your internet speed, this could take a couple of minutes. Hit the refresh button if you want to wait for it. Alternatively, you can follow the package creation on the executing jobs panel.
- Over time, as you update the configuration or payload (War file), you’ll create more packages, which are a versioned snapshot of the configuration and payload at the time they are created. You can also use external plugins, such as our Jenkins package plugin, to create packages from Jenkins as soon as the War file has been created from your build process.
- Now you can run a new job to the environment of your choice.
- Navigate to Jobs-> New Job.
- Double click on the ‘Empty’ project job box, and select the project you created earlier from the droplist.
- Select the Target you want to deploy from the droplist.
- Select the Version (package version) you want to deploy from the droplist.
- Since there is only one package, it is preselected. The latest package will always be preselected by default.
- Click on the Run button in the bottom right corner, enter a comment for this run and click and click Yes .
- The deployment is started. Click on the Running Jobs icon in the top right corner and you see the tasks executed and job log in real time.
- Once the job completes, you can check the installation by accessing the Tomcat management app at http://localhost:8080/ (Username: tomcat, Password: tomcat)
- You can browse the Tomcat installation under /usr/local/tomcat7.
Further Reading
The following links will help you gain a deeper understanding of the tasks used in this project:
- Explore the Script Demo Project
- TomcatBinaryInstallTask from the Tomcat plugin
- CopyTask from the Folder management plugin
- Use of Built In Variables
- YouTube video demonstrating this project.
Reviews
There are no reviews yet.