Professional Documents
Culture Documents
Continuous Integration?
As soon as Developer push the code , the CI system(Jenkins) get the code from GIT.
It will run the unit test cases using maven. Then it will build,
will send the email notification to Developer, weather build is Success or fail.
5 java –version
Give the Job name, select pipeline project type and then click on OK
“maven3.6.2”
/var/lib/Jenkins in the Jenkins home directory we see /tools directory here we will see maven3.6.2
‘maven3.6.2’ tool name will assign, the above path to variable ‘maven’
Install Tomcat
The prerequisite is Java, so first install Java
1 cd /opt/
5 java –version
ls
unzip apache-tomcat-9.0.65.zip
cd apache-tomcat-9.0.65
ls
cd bin/
In bin directory we find startup.sh and catalina.sh files, these files are useful to start the tomcat
server.
ln -s /opt/apache-tomcat-9.0.65/bin/startup.sh /usr/bin/startTomcat
ln -s /opt/apache-tomcat-9.0.65/bin/shutdown.sh /usr/bin/stopTomcat
Cd /opt/
Starttomcat
Tomcat is started
Deploy is nothing but keeping the war file into Webapps directory
To copy file from one server to another server we use scp command.
Need to create SSH agent token for providing Tomcat credentials to Jenkins.
steps{
sshagent(['61cf36c3-649c-461a-bd1c-ac157c21c2a6']) {
To trigger the build automatically when there is updated code in the GitHub
Pool Scm→30min →ongoing development→every 30min Jenkins will check in Github ,is there any
updated code or not(commit Id is diff),build is going to trigger.
Build periodically→ selenium test cases→need to run everyday night 12am→what ever timeintervel
you have configured it will trigger, irrespective of updated code.
GitHub webhook→instead Jenkins go and check, Github will inform if there is updated code,and
Github will trigger the Job.
In the GitHub goto repository and click on settings Tab, and add the webhook
As payload url give the jekins url and give the context path as ‘github-webhook’
You can see in console output ,the Job was triggered by ‘Github push’