Saturday, 18 April 2020

Jenkins and Tomcat setup


  1. Jenkins :used for Continuous  Integration  and continuous delivery
  2. Help video playlist for jenkins and Tomcat :

  3. ******************* Jenkins installation *******************************
  4. Download Jenkins war file from - https://jenkins.io/
  5. Place the war file at E:\Jenkins
  6. Go to windows command prompt  where jenkins.war is placed  and run -
  7. E:\Jenkins\ java -jar jenkins.war
    OR
  8. E:\Jenkins\ java -jar jenkins.war --httpPort=9090  ( To start jenkins (standalone) on a diff port )
  9. Capture the password , or get it from E:\Jenkins\secrets\initialAdminPassword
  10. Do not save the password if asked by browser
  11. Go to browser - http://localhost:8080 (Jenkins window should show up)
  12. Select plugins to install ---> Click suggested and click install
  13. Get started with Jenkins
  14. username : admin
    password  : admin123  ( password is captured at step  7 above)
  15. From C:\Users\<logged inuser>\.jenkins   move all stuff to E:\Jenkins\JenkinsHome

  16. ******************* Tomcat installation *******************************
  17. Download Tomcat and unzip it and place in E:\Tomcat folder
  18. Copy/Place the jenkins.war file inside E:\Tomcat\webapps    folder
  19. Step 4 :  Set Environment Variables
  20. System Variable:
    JENKINS_HOME = E:\Jenkins\JenkinsHome
    CATALINA_HOME = E:\Selenium\Tomcat
    JAVA_HOME = E:\Selenium\Java\jdk131
    JRE_HOME      = C:\Program Files\Java\jre-10.0.2   ( without semicolumn)
    CLASSPATH     = E:\Selenium\Tomcat\lib;
    PATH          = %PATH%; %JAVA_HOME%\bin;%CATALINA_HOME%\bin;%CLASSPATH%\servlet-api.jar;

  21. verify if  Jenkins is running on tomcat : http://localhost:8080/jenkins
  22. To start Tomcat  run      E:\Tomcat\bin\startup.sh
    To shutdown tomcat     E:\Tomcat\bin\shutdown.sh
  23. Verify if  Tomcat started http://localhost:8080
  24. To restart running  Jenkins  http://localhost:8080/jenkins/restart
  25. To Start and Stop Tomcat from command prompt :
  26. To start --> E:\Tomcat\bin\startup 
    To Stop  -->E:\Tomcat\bin\ shutdown
  27. To see all commands list for CLI  http://localhost:8080/jenkins/cli/ 
  28. How to change default port 8080 : Go to E:\Tomcat\conf  >> Edit server.xml >> Search "Connector port" >>Replace "8080" by your port number >>Restart tomcat server.


  29. Common Plugins:
  • Role-based Authorization Strategy
  • Deploy to container Plugin
  • Credentials Plugin 
  • Email Extension Plugin
  • Build pipeline
  • Delivery Pipeline Plugin
  • Blue ocean
  • poll mailbox trigger plugin
  • Build Monitor view

status notifier  tool for Jenkins : CatLight.io



+++++++++++++++  Automatic Deployment Steps  +++++++++++++++++++++++

Add Post build actions: Deploy war/ear to container
war/EAR files : **/*.war
context path : sample  ==> without .war extension
containers : Add Container (eg Tomcat9)
Manager user name : deployer
Manager password  : deployer 
Tomcat URL   : http://localhost:8080/jenkins/

e:\Tomcat Folder >> conf >>  tomcat-user.xml
 >> add below line at matching place 
<user username="deployer" password="deployer" roles="role1"/>

No comments:

Post a Comment