Professional Documents
Culture Documents
Installation of Jenkins
Installation of Jenkins
Setup EC2 instance - Install Java, Install Jenkins, Start Jenkins, Access Web UI
on port = 8080
a. Ensure that your software packages are up to date on your instance ==> sudo yum
update –y
Add the Jenkins repo ==> sudo wget -O /etc/yum.repos.d/jenkins.repo
https://pkg.jenkins.io/redhat-stable/jenkins.repo
Import a key file from Jenkins-CI to enable installation from the package ==>
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key; sudo yum
upgrade
e. Configure Jenkins
Install Amazon EC2 plugin
Configure a cloud
Add a new cloud = Amazon EC2
AWS EC2 Credentials -> Add:
select Kind = AWS Credentials and add IAM User
programmatic access keys with permissions to launch EC2 instances = Access Key and
Secret Key
Region -> Select
EC2 Key Pair’s Private Key -> Add:
select Kind = SSH Username with private key and add
the Private-Key
Test Connection = Success
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------
a. Install git on jenkins server => sudo yum install git -y; git version
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------
3.
sudo cd /var/lib/maven
sudo wget https://dlcdn.apache.org/maven/maven-3/3.9.0/binaries/apache-maven-3.9.0-
bin.tar.gz
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------
/opt/apache-maven-3.9.0
source ~/.bash_profile
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------
Build and check if you are able to connect to Gitlab and get the code
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------
4.
sudo su -
cd /opt
wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.72/bin/apache-tomcat-
9.0.72.tar.gz
cd apache-tomcat-9.0.72/bin/
chmod +x startup.sh
chmod +x shutdown.sh
ln -s /opt/apache-tomcat-9.0.72/bin/startup.sh /usr/local/bin/tomcatup
ln -s /opt/apache-tomcat-9.0.72/bin/shutdown.sh /usr/local/bin/tomcatdown
tomcatup
cd ..
./conf/context.xml
./webapps/examples/META-INF/context.xml
./webapps/host-manager/META-INF/context.xml
./webapps/manager/META-INF/context.xml
vi ./webapps/examples/META-INF/context.xml
vi ./webapps/host-manager/META-INF/context.xml
vi ./webapps/manager/META-INF/context.xml
cd apache-tomcat-9.0.55
cd conf
vi tomcat-users.xml
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="admin" password="admin" roles="manager-gui,manager-script,manager-
jmx,manager-status"/>
<user username="deployer" password="deployer" roles="manager-script"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------
Create creds
Add tomcat deatils and build
cd webapps - here war file gets deployed
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------
CICD: