How to build and deploy the sample application using Jenkins

Introduction

In earlier versions web applications build and deploy are process manual. clean the code then compile it then build into one component(jar, war, ear). Then deploy into the tomcat, JBoss, resin, was application servers this is the scenario. It's hard to complete all steps when new changes in the code right. so to overcome these all are problems (integrated tools are into existence). No need to clean, compile, build, package, deploy all are in a single configuration. For better understand end of this article. I will show you the how to configure, build and deploy into the application server.

Environment setup

Java installed on your system. (If not installed click here to get executable file).
Git installed on your system(If not installed click here to get executable file).
Jenkins installation clicks here
Maven installation clicks here.
Tomcat service click here

Before build and deploy the application you need to learn how to add plugins and how to add global tool configurations setting in Jenkins click here.

Develop a web application. push into git-hub,git-lab, or bit-bucket repository. if you don't know the How to push your code into repository click here.

You can configure the application from local in Jenkins but a number of peoples are working from remotely you can better to go SCM (source code management )click here to get full knowledge on repositories.

All environment setup ready right. follow the below step to get full knowledge on setting configuration on Jenkins.

Before the configuration, you need to add the below plugins.
Git: For SCM(source code management).
Deploy to container PluginFor deploy the application in application servers.

Step1: login to your dashboard.
Dashboard
Step2: Click on new (left side of your dashboard).
Step3: Enter the project name and select freestyle project(which type of your project), then click on ok.
ProjectName
Step4: In the description, the section adds about your project.
Description about your project
Step5: Tick mark on GitHub project checkbox. add the repository of your project URL.
SCM
Step6: In Source Code Management section tick mark on Git and add the repository of your project URL.
scm
Step7: In build triggers section tick mark on poll SCM (here you can schedule your job (like Cron jobs) here ***** means for every one minute clean and build and deploy the project into a tomcat server.
scheduling job
Step8: In Build Environment section tick mark on Delete workspace before build starts, because every build information stored on the workspace, to save the memory, so here I am Delete workspace before build.
Delete workspace
Step9: In build section select invoke top-level maven targets(here I am creating the maven project right that why here I am selecting maven targets). then select your variable (in global tool configuration) Home. and type the install(to create the package .war file) in goals section.
Maven targets
Step10: In Post-build Actions select the deploy war/ear to a container, in WAR/EAR files section add the **/*.war(it means fetch the war file from the workspace).
Step11: Context path (whatever you want or  /)
Step12: Add the Tomcat URL (http://ip:port).
war deploy section
Step13: Click on save and apply buttons and then click on the build now button. your build process is running after the successful build (it will show the blue button) if the build fails it will show the red button and you can also check the console output.
Output
Console output
Step14: After successful deployment, you can check your tomcat and test the application whether it's successfully deployed or not.
Final Output

Output through video 


SUBSCRIBE TO OUR NEWSLETTER

I’m the Founder of quickdevops.com. I am a Professional Blogger, Application developer, YouTuber. I’ve been blogging since 2015.I spend a lot of time learning new techniques and actively help other people learn web development through a variety of help groups and writing web development tutorials for my website and blog about advancements in web design and development.Besides programming I love spending time with friends and family and can often be found together going out catching the latest movie or planning a trip to someplace I've never been before.

17 Responses to "How to build and deploy the sample application using Jenkins"

  1. The next time I read a blog, I hope that it doesnt disappoint me as much as this one. I mean, I know it was my choice to read, but I actually thought you have something interesting to say. All I hear is a bunch of whining about something that you could fix if you werent too busy looking for attention. Latest & Updated Version

    ReplyDelete
  2. This is an excellent post I seen thanks to share it. It is really what I wanted to see hope in future you will continue for sharing such a excellent post. TubeMate APK iPhone Download

    ReplyDelete
  3. I know this is one of the most meaningful information for me. And I'm animated reading your article. But should remark on some general things, the website style is perfect; the articles are great. Thanks for the ton of tangible and attainable help. samcart

    ReplyDelete
  4. www.bbdd66.com 우리카지노사이트
    www.bbdd66.com/theking 더킹카지노
    www.bbdd66.com/sands 샌즈카지노
    www.bbdd66.com/first 퍼스트카지노
    www.bbdd66.com/yes 예스카지노
    www.bbdd66.com/super 슈퍼카지노
    www.bbdd66.com/gatsby 개츠비카지노
    www.bbdd66.com/33 33카지노
    www.bbdd66.com/world 월드카지노
    www.bbdd66.com/merit 메리트카지노

    ReplyDelete
  5. Android App Development has been in demand since its advent. Here are the latest trends enveloping the market. Veracious Tips for fitness apps

    ReplyDelete