Jenkins Install in EC2-V0.1
Jenkins Install in EC2-V0.1
Jenkins Install in EC2-V0.1
You can use Putty or MobaXterm to login to EC2. Need to use the key downloaded from EC2
security group to login.
https://www.jenkins.io/download/
Use the Red Hat version of download for Linux based EC2.
https://pkg.jenkins.io/redhat-stable/
Note: If you missed to install the above epel package, you may not be able to install Jenkins.
you can install java-11 openjdk and Jenkins with the following command
(or) you can use the below to install java-11 openjdk and jenkins
yum install fontconfig java-11-openjdk
yum install jenkins
You can start the Jenkins server using “service Jenkins start”
You can check the status of Jenkins using “service Jenkins status”
Use the public IP of the EC2 instance . While creating EC2 instance, you should have enabled port
8080 in the security group. If not then update the security group for 8080 so that you can connect
with Jenkins from browser using the EC2 instance IP address.
The default password for Jenkins admin user login will be available in the path in EC2:
/var/lib/Jenkins/secrets/initialAdminPassword
Git should have been installed in the EC2 instance along with Jenkins so that it can pull code from the
GitHub. The above figure shows where the developer has git installed in his local machine so that he
can push the completed code to GitHub then the git in EC2 server along with Jenkins will pull the
code from GitHub.
Note: If you want to change the hostname of your EC2 instance for your viewing convenience then
you can update the /etc/hostname.
To install Git in the EC2 instance where Jenkins was installed, use the below command.
To install github plugin in Jenkins GUI, goto Manage Jenkins option in the Jenkins GUI. Select Manage
Plugins. Goto Available tab. Search for github. Select GitHub and click install without restart.
After install of github in Jenkins GUI, select Manage Jenkings option in the Jenkins GUI. Select Global
Tool Configuration in GUI to configure the path for git installed in the EC2 server with GitHub. The
command ‘whereis git’ in EC2 will give the path of git in EC2. But we can optionally just state ‘git’ in
GUI for the field ‘Path to Git executable’ and no need to specifically give the complete path.
The steps for Maven installation in Linux are available in: maven.apache.org/install.html.
Copy the URL for Maven download from the website and download to EC2 using wget followed by
the URL path. Extract the tar.gz file. Set the path for mvn executable in .bash_profile. Edit
the .bash_profile file and set the M2_HOME=/opt/maven and M2=/opt/maven/bin then set
JAVA_HOME=/usr/lib/jvm/….(the jdk filename here). Update the PATH variable in the
same .bash_profile with $M2_HOME:$M2:$JAVA_HOME
Install Maven plugin in the Jenkins GUI by searching for Maven integration plugin through Manage
Jenkins. In configuration, provide configuration for JDK path of EC2. Provide the build path aswell.
After installing and configuring Tomcat. You can start the Tomcat server using:
/opt/tomcat/bin/startup.sh.