The objective is to create a Jenkins job to automatically deploy a built war file to a Tomcat instance. This project basically covers the configuration of Jenkins.
The machine already has the following software installed from my previous tutorials:
- Jenkins 2.x: This video explains how to install jenkins in an AWS EC2 instance.
- Port: 8081
- Tomcat 8.x: This video explains how to install tomcat in an AWS EC2 instance.
- Port: 8080
- User: admin
- Password: adminadmin
1. Git
sudo yum install git
To know the installation path:
which git
whereis git
output: /usr/bin/git
2. Java 8
- It wil be installed automatically from Jenkins Tool Configuration (web).
3. Maven 3
- It will be installed automatically from Jenkins Tool Configuration (web).
4. Deploy to Container plugin
- It should be done manually.
- Path: Manage Jenkins -> Manage Plugins -> Available -> Deploy to Container plugin
- Restart Jenkins after installation.
Empty Spring Rest Project: GitHub link to download the empty spring rest project.
- This is the WAR file that we are going to deploy from Jenkins to the Tomcat container.
- url: https://github.com/carlosCharz/emptyspringrestexample
- You should have a github account (username and password).
4. Job Configuration - Project Type
5. Job Configuration - General Data
6. Job Configuration - Source Code
7. Build Configuration - Delete Workspace