DevOps Project with Git + Maven + Jenkins + Docker on AWS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] a new video regarding the continuous integration and continuous delivery by the integration of get maven jenkins and docker so i am currently present on my github repository repository name is ci cd get me and jenkins and docker this is the project diagram in the last project i've shown you how to build and deploy your application so in this project you can see that the deployment will be done on docker uh through the publish or ssh plugin which we will configure in the jenkins it will be running on an aws ec2 and when the deployment has occurred it will result in two uh apps the first one is our application our web application and second one is the tomcat server uh both of these will be will be a part of the docker file which will be executed and deployed onto the container uh these are the commands which i'll i'll be executing uh during this tutorial so i'm starting with the first one command which is to launch an ec2 instance for the docker host so let me install an instance okay let me rename this instance to docker host okay so now it's in running state and this is the public id address okay so i am going to configure this system so i am using the ssh software mobix term the username here is ec 2 dash user use private key i have already downloaded okay so i have now logged in to my console let me clear the screen so let me now execute the set of commands i'll go to my repository here first i will install docker on this instance and will start the services so i'll run this command first [Music] okay so let me clear the screen then the second command service dock will start to start the docker services okay so now you can see that our docker has been started services and we can also verify it with the docker dot service command that is currently active and running state let me clear screen so next uh we'll create a new user for the docker management and add him to the docker default group so this is our username docker admin and with the username command we will be adding this docker admin user okay so for password okay so it's asking me for new password okay so all authentication tokens updated successfully so we have created the user docker admin let me clear the screen okay so now we will add this user to the docker group with this command so user mode dash aeg docker dot okay so this this user has now been added to the docker group uh now i will write a docker file inside this folder and will paste this code inside it so let me go first go to the folder here i'll create the docker folder let's go inside and here i will write a docker file the docker d will be capital here with a nano command docker file i will now copy the code from here and paste it to my docker file okay so with this code uh is basically pulling the tomcat image contract line image from the repo then the main [Music] you can write it or you can ignore it and the third important is to copy the where file onto the container the val file which is the form dot xml file written in mail so it will be copied from this location to the newly created docker uh host at this location web apps so this uh this is the contents of the docker file so i am exiting uh best one for the saving the file okay so the next we will uh we will login to our jenkins console and add the docker service to execute commands from jenkins so let's uh first log into the jenkins okay so now i will start my jenkins master first so instant start instance okay so this is the public ip i'm copying it and pasting in my in my browser okay insert the username and password okay so first i'll add the docker service detail by going to many jenkins then to configure system in this configuration window you will find the publish over ssh if i can scroll down it's here publish or ssh and these are the server the s6 server i'll delete this one so sa server here i'll add the new server the name of my instance the docker host let me scroll it down the docker code so i'll mention it here docker host then the host name host name is the private ip address of the system my docker host private ip is this one and the username we have configured earlier was [Music] docker admin here i'll click on advanced here i'll write the password which i have mentioned for the docker admin so we have provided the the name of the host docker host the host name the ip and the username docker admin and then the password so i think these details are quite enough what is 22 and then proxy time okay so let me test the configuration first okay fail to connect or change directory ah there's some authentication field message so [Music] okay okay so to rectify this problem i need to enable the password-based authentication which is currently disabled my system so let me go to the docker host computer this is my docker host okay so this is the file so at the bottom i'll enable the password authentication and for enabling i am removing this ampersand sign okay okay so now i'll save it yes okay so i'm going to jenkins again to configure my server and now i'll test the connection again let me test it again okay first i'll have to restart the service okay so let me check the test configuration again okay so now it's in success message okay so let me go to my jenkins repository okay so we have added the docker server and credentials so now we'll be create a jenkins job so for that i am going to first time saving this okay so now i will create a new jenkins job by clicking on new items the project name i'll write here the docker docker project it's a main project and click ok ok description i am writing this is uh get me jenkins daughter integration okay the source code management here i'll mention the get repository the url which is this one copy paste it here okay here my branches main branch okay so in the pre-steps i'll go to send files or execute commands or ssh okay so here i'll define the further configuration my host name is already selected docker host my source files are here i want to remove this prefix i'm removing this and my remote directory is opt docker and these are the execution commands which i want to run okay so i have defined the source files which are static dot war and the prefix will be removed then my remote directory and then the execution of commands if i can show you a bit these are in fact when the image is already created and the container is running so it will remove that it will first stop that docker container then remove it then remove the image of it and then we'll go to the slash opt slash docker folder and then we'll build this image by the name docker underscore demo okay so i think okay uh for uh here i am just uh specifying the building i'll create a new uh send files the execution command so i'm copying the code pasting it in the execution command and the source uh okay so we have already specified the docker host so here our image will be built and here the docker file will be executed in this motion with this command this is a docker run command uh this is the name of our docker and this is the port 809 90 which will map to this one uh we can also write a080 here but i am writing it 8090 so that to differentiate between both and this is our docker file name which will be executed on our runtime and the container will be generated okay so i'm i guess this is it and let me say let me save it okay so now let me build this shop okay so there's the yellow icon let me check it okay so the finish is unstable okay so let me execute one more command of ch own here uh ch own minus rs very custom and then document which are user docker admin and then the destination which is slash opt slash invalid user docker admin okay i've written it mistakenly docker admin okay let me clear screen so now let me execute the build again okay so this time our build is now successful and the build is successful and this is a war and jar file which has been deployed so let me check the application let me first copy this public ip address okay so you can see that this is the tomcat server which is the result of the docker file and inside it will write web this is the application which has been deployed developed with my own project deployment on tomcat server using jenkin file which is which is inside the web app and this is index.jsp this is the code which has been executed let me go to the vs code and change my code from there vs code i am cloning my git repository by cloning the repository and then the url of this repository code copy and then to my vs code here asking me about the folder so i'm creating a new folder docker project select repository location so it's now cloning my gate [Music] so this is my code let me add another line to the score using jenkins cicd by line why where did this new line so let me save it and then on the terminal window i am adding time first of all giving the command of get dot let me check the status so one file index.jsp has been modified so get so one file has changed now so let me write that one yet push origin mean in my case it's mean so the file has now been pushed and let's see when it turns again here let's see the sixth build now okay so it's arrived you can see that now at the build stage so my build and deployment is often as shown okay so here you can see that the third line has been added using jenkins ci cd pipeline which i have done to the uh by inserting the code into the vs code so this was about this project of the ci cd using docker and we have deployed our application to the talker so i hope you people have liked this video and this has been an informative video for you [Music] you
Info
Channel: Cloud Guru
Views: 638
Rating: undefined out of 5
Keywords: amazon git, devops project, aws maven, amazon git docker, aws, amazon web services, simple devops project, project on docker, cicd, devops on aws, devops project for jenkins and docker, Jenkins ansible and docker project, ci/cd on aws, docker on EC2 instance, how to deploy a war on container, how to setup cicd for jenkins docker, docker project, jenkins project, cicd project for docker and jenkins, devops project from scratch, jenkins job for docker, Git, Maven, Jenkins, Docker
Id: mEQD5S_cDvs
Channel Id: undefined
Length: 22min 36sec (1356 seconds)
Published: Fri Dec 03 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.