Deploy War File on Tomcat7 using Jenkins

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guest accessibility welcome to the session and deploying wire file on Tomcat 7 using the Jenkins so Jenkins is in continuous integration tool which is going to help the software developers to automate few of these software development lifecycle steps such as running the unit test cases running the integration test cases and building your software and finally deploying your executable file to our target environment so in this session I am going to explain how you can deploy in a verifier on the Tomcat 7 using the Jenkins in order to proceed with this video make sure that you install the below surface on your computer and I'm going to explain each tool why we are going to use as we progress but make sure that you need to install the Jenkins get SCM plonking and mavin plugin and deploy container plugin so these three plugins we need to include add it to the Jenkins tool once you have done that then it may or may not require the github account URL because in this session I have created a small web project and I have hosted this webs or a web project on this particular github account if you don't have that github account also you can pull the code from this one and you can continue with this video and then you need to install the Tomcat 7 because we are going to deploy our executable require file on the Tomcat 7 environment as we are using the get as a source code man our source control management tool so make sure that you install the gate on your computer and also mavin so I already installed all these soft race in my local computer so I am going to show you which are the which are the websites you need to visit so this is my github repository where if you want to clone this particular piece of code then you can use this URL and you can clone to ever local in this video I am NOT focusing on how github works or the how Jenkins works and how Tomcat works the main focus is I am going to create a executable file and I will show you how Jenkins will help you to automatically deploy the executable wire file to the target and moment that is a tomcat seven so this is a very simple project I have created and what happens is whenever you deploy this executable wire file on the target environment it is going to display you drinking successfully deployed where foil in Tomcat 7 this is the message you are going to see it except that it does not have a much functionality but here my focus is basically I want to show you the list of steps or the sequence of the steps you need to follow in order to achieve this particular task now now the second one is unit you can instead you can download the drinking software from this website Jenkins website and similarly Apache Tomcat 7 also you can download currently I am going to explain how to deploy the where file on the Tomcat 7 but if you want to follow the same if you want to deploy to the Tomcat 8 also you can follow the same steps now let us go ahead and start now these are the softest I already downloaded so I will show you what are the things it requires first one is you need to handle Java it needs to be installed on your computer so it is already there in mind so make sure that you already installed the Java and then we need the mavin also needs to be need to be installed so Marvin version so in my computer the man was need three dot 3.9 it has already installed and then I already installed the Tomcat 7 anyhow and then finally get so if I shift right-click then you can see that git bash option here and this means I already installed guitar my computer so if you want to see what the version I have installed get version so I already installed get version 2.7 dot 3 dot Windows Start 1 so I am good to go with the to deploy the our while our Nova Tomcat 7 so before that what we need to do first we need to read to start the Jenkins so in order to start the Jenkins - char - jarrah jar and then Jenkins fire now this is going to start the Jenkins server once they started it can be it can be accessed through thee localhost 8080 port number localhost 8080 so it takes a few seconds to actually up and running and then in the meantime let it be then we will go through the tomcat step now target I exist I installed on my I downloaded a 7.0 dot six five and I can go to the bin directory basically okay so I go into the building directory here right-click shift right click then you will get an option for the open window a command window here and then you can start but here one point I want to highlight is that now Jenkins is actually by default it is running on the h0 h0 port member now even if you by default Tomcat also what happens is it also by default port number is 8080 hence if I start Catalina back cuttle not bad dot start then it says that already 88 is bind already port number 80 80 is used already used hence you can see an message saying like the binding exception you will get it okay so initializing binding exception I will come so JVM bind 8080 because it is already use it deep drinking's already using the same for hence we need to change the port number for this particular target how we can do that one is go to the config and then open the server that XML file in this we have a connector port number here so this we are going to we need to change actually as in my local I already starting the to our Jenkins on the 8080 port member that is the reason I am changing this particular port number otherwise it is not required ok now what I can do is I can start my tomcat also now in order to start the Tonga Carolina dot bad start now it will start the Tomcat server which can be available at the port number 9090 so my Jenkins is up and running so I have account to be the admin admin so that is the reason I told you that this focus this video does not focus how Jenkins works I am expecting that you already installed the Jenkins and you know how to work with the Jenkins then this steps they then in this tutorial what I am going to explain how you can deploy our how you can deploy the where file using the Jenkins automatically to the Tomcat 7 ok so the next step is you can execute the Tomcat on 9090 port number 90 90 so once you seeing this man if you see this message also if you are seeing this you have successfully installed Tomcat congratulations now in order to deploy the wearer of airfoil at the airfoil on the Tomcat server you need Ian admin religious so just to try try to click on this server as we didn't configure any users at it will give you an alert message saying like we are not it is not at all authenticated so in order to do this authentication we need to add in users to this Tong server that means admin users we need to use if you see here you are not authorized to be this view view to this page this is because we haven't set up any admin users for the Tomcat so what we are going to do is we are going to create a one user and then that user we are going to use for two we are going to create a basically admin user using that we can access this access these pages so in order to create the Tomcat user we have to go same the config folder and then tongkat users and try to edit this one and what we need to do is we need to create a two roles actually let me copy paste here and then one roles we need to so what I am going to do is there are two roles it requires one is manager GUI and another role each manager script and these two roles we are going to give for the user admin and password also I am providing as a admin and this admin has the roles for both manager Gy thermal manager script okay so once we add this rolls to this particular user now this user is an admin for this particular application to deploy the reference now what I'm going to do is I will just restart this server started okay so it is starting yeah it is up and running now let us go ahead and start once again access the admin admin now we are able to access the tomcat application using the admin admin so now this user has an access to deploy the where files aren't to the Tomcat server now what we are going to do is using this admin user we are going to add in plugins to the Jenkins and we are going to provide these users for the deployment then Jenkins once it come it builds the project automatically this will deploy the where file to the tomcat server now let us go ahead and start now once you login to the Jenkins first step what you need to do is you need to install the plugins what are the plugins I explained in the mandatory for this tutorial that needs to be installed in order to install go to the manage plugins and from this plugins you can see that what are the allow available software's and from here we need to select the SCM plug-in maven plug-in and deploy to the container plugins okay so these three are mandatory to proceed with this video okay so once again I show you make sure that you install these three plugins and then you can continue if you see the installed software is list you can see that all these chakras is already installed on my computer one is get plugin so this is already installed and next one is deploy to container plugin this is also installed and then integration plug-in so these three surface is already installed so what now what we are going to do is once you complete the installation of these three plugins then you come to drink is folder we are going to create a new item and here I am going to give the project name ask Tomcat deployment this is the freestyle project click OK okay so now what we need to do is we need to connect it to the github racer repository hence select source code management source code management as a gate and we need to provide the repository URL as I explained we need to give the repository URL for this Jenkins vert file that can be accessed to this URL so what I am going to do is I am going to provide thee my github repository URL and as this is the public domain you may not require the credentials but if it is any private repositories then you need to make sure that you need to add the credentials for example in my for my account so C by Java Tech is a user that is my github hosted username and password similarly you can create your own github repository and you can provide the credentials in order to provide the credential just to click on this Add button and Jenkins here you need to provide the user name and then password and also give me some description so that what happens is when you next time when you come to the repository URL and the credential it will give some description about it what it means which credentials are market Rosa which repository okay so once you have done that a repository URL by default it has the master branch only no need to change anything here and the next step what you need to do is we need to create the build step so in the build step we are executing the windows batch command in this windows bash command I'm going to give the MBL clean package because my project is the web project so when magnin clean and built our package it it will create a verify and then once this builds successful in the post bill actions I need to say that and what this needs to be deployed to the Container so we need to add the post build action there deploy where our to the container so what my were what is my rifle is when as we know that when Tomcat build the build your application it is going to place the wearer year file on the target folder so target and then project file named Jenkins where dot verified and context fourth is not required and then if you give so the next one is a containers currently we are going to deploy the term or the where file on the Tomcat 7 and also in order to deploy the where fell and the Tomcat we need the admin user that is the reason what the admin user we have created there is admin is the user now so I am going to add this one in the global admin admin I will say that Tomcat admin in the description similarly here also I will say Tomcat admin then add it so space it is not taking so you can say that admin admin so add to the credentials list now you'll see option admin admin and then Tomcat URL currently in my local the Tomcat is can be accessed through the port number 90 90 so we need to provide this URL so now what Jenkins is going to do is first it is going to pull the that means it is basically clone the data from this github repository and then it ago it is going to execute the marine commands then it is going to base the bear file and finally it is going to deploy the vert file on the target environment that is the Tomcat 7 and say no so now I have created a project in the Jenkins to do all these steps before we run we need to configure one more step because once you add the plugins what we need to do is go to the manage plugin manager Incans and then go to the global tool configuration in the global tool configuration tool we need to provide the few steps for example what is the version we are we want to execute and that is the reason you need to make sure that JDK installation whatever your computer has there then configure that one similarly for the get also which location you have installed the kit and similarly for the maven so make sure that these three you need to setup in the global tool configuration because by using these tools as should be by using this configuration Jenkins will try to execute all the get and maven commands so make sure that you also configure here once this is everything is and now I can go to the Jenkins and Tomcat deployment is our project and now clicker bill now now what it is going to do is if if the configuration everything looks proper then this will pull the code from the github repository build the project and create a verify and once creating barfle completed then it is going to deploy to the container and build will be successful if there is any any mismatch or the wrong with the configuration then it is going to fail let us see how let us wait for some time so that it way in the meantime it is going to complete the build now once again let me refresh here it's not it completed it's still running so if you want to see the progress on the bill you can just click on it and see the logs so build is successful see whatever I explain everything you can see step by step so first what it has done is first it has fetch the code from the Jenkins where and then it started executing the mavin commands see mavin clean package it has done and then build is successful sorry we need to give the complete URL here so this has failed because it's saying that local host is it is unable to find the local host just what we need to do here is go to the project and the configure and go to the configuration step here just we need to give the complete HTTP HTTP : localhost 99 save it and then build once again now it will start building it so again if you want to see the status click on the arrow now building successful now if I open the console again then we can see that so it has similar it has cloned it and then executable successful and has created a ver file and finally it has deployed our wire file to the broken now if I go ahead and see the application list of application Jenkins varies deployed now once you click on it then you can see that junking successfully deployed we're filing Tomcat so we successfully deployed where file on the Tomcat using the Jenkins so once again I am going to I take the steps what first step what we have done is this is the github project which is going to create a ver a file and once where file is created successfully then it is going to display a message saying like Jenkins successfully displayed where file under Tomcat 7 and the next step what we had done is in the Tomcat we have included the necessary plugins that is a cm plug-in that is gate gets a CM plug-in and the maven plugins and also deployed to container plugin once this come can plugins are added then you need to do the configuration that means global tool configuration where you need to provide the necessary paths of fewer local so that Jenkins use those configurations while executing the get and the Marvin commands once that is done we have created a project in order to execute this complete process that is Tomcat deployment the storm care deployment will have first step is need to configure the github URL and then we are given the execute we have given the Mammon command to build the we're fine and finally we have provide the post our build action as a deploy bearer to the container which has done the deployment part of it hope you are clear with the steps how we are going to deploy the work I learned the term gate and if I have any questions please comment on my youtube video please to subscribe to my youtube channel to get more technical videos thanks for watching have a nice day
Info
Channel: Siva Reddy
Views: 59,239
Rating: undefined out of 5
Keywords: sivareddy, shiva reddy, siva reddy, Jenkins, Jenkins installation, Automation, Jenkins installation on windows, jenkins pipeline, how to use Jenkins, Tomcat, Integration, code quality, code coverge, Gradle, sonarqube, sonarscanner, deploy WAR file on Tomcat 7, War deploy on Tomcat7, WAR, Automatic deployment, deploy war file in tomcat, deploy war/ear to a container jenkins, deploy war file in tomcat linux, deploy war file in docker
Id: jfM1GiTOHSc
Channel Id: undefined
Length: 25min 51sec (1551 seconds)
Published: Sun Dec 24 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.