⚙️
DevOps Mastery on AWS
  • 🤓Continuous Integration & Continuous Deployment on AWS Cloud
  • 🤖Jenkins
    • 🛠️Build Jenkins First Job
    • 🦸Launch 2nd EC2 instance
  • 🐳Docker
    • 📁DOCKERFILE
  • 🛺Ansible
    • 📖Ansible Playbook
  • 🏃‍♂️Continuos Integration with GitHub and Jenkins
  • 👷Project Structure & summary.
  • Basics
Powered by GitBook
On this page
  1. Jenkins

Build Jenkins First Job

In this section we will create a Job and Jenkins will provide us with the build file.

PreviousJenkinsNextLaunch 2nd EC2 instance

Last updated 3 years ago

Click on create new jobs:

Enter the item name, select job type and click OK. We shall create a Freestyle project as an example.

Once you click OK, the page will be redirected to its project form. Here you will need to enter the project information:

You will see a Git option under Source Code Management if your Git plugin has been installed in Jenkins:

Enter the Git repository URL to pull the code from GitHub.

Scroll Down and click on Add Build Step >> Invoke top-level Maven Targets:

In the Goal section type " test install " maven command this command is used to test and create a build file.

APPLY and SAVE.

Now we need to provide paths for JAVA, Maven and Git to jenkins:

  1. Go to Jenkins Dashboard

  2. Manage Jenkins >> Global Tool Configuration

  3. You will see window like this

  4. Here we have to provide path for JDK, Git and Maven(scroll down )

  5. Click on ADD JDK >> untick install automatically (because we have already downloaded it we just need to give the path) Login to EC2 shell and type the following commands

echo $JAVA_HOME //copy the path and paste in JAVA_HOME
which git //paste the git path 
echo $MAVEN_HOME //copy and paste in Maven section

(Note down the name of Maven you entered you have to change it in Build step section where we wrote "test install" command)

Apply & save

Lets Build

Before we click build now we need to do small task. Navigate to JENKINS Dashboard and select your job >> Configure >> scroll down >> Select the Maven name you entered in previous secton

Now click on Build now and see the console output

If you Success. Congratulations, Jenkins has successfully created .war file we can see the file in the destination provided in console out lets check it.

Apply and Save

As you can see we have the webapp.war (build file) Now we need to deploy this on Tomcat Server which we will host on another EC2 server with Docker Containers

🤖
🛠️
🐳