Auto-Deploy Java Server Faces (JSF) Web Application To Amazon Web Services (AWS) cloud Using Jenkins CI


Published on

More on the steps at:
There are few more in my blog on the topic.

Published in: Engineering, Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Auto-Deploy Java Server Faces (JSF) Web Application To Amazon Web Services (AWS) cloud Using Jenkins CI

  1. 1. James Singh Maharishi University of Management 04/23/2014 Web Application Architecture (WAA) Honors Project (presentation) Auto-Deploy Java Server Faces (JSF) Web Application To Amazon Web Services (AWS) cloud Using Jenkins CI
  2. 2. Old School way of deploying Java/JSF applications: 1. Build the project to get .war file 2. Upload the .war file to server Major Problems: 1.Version control isn't inherent. 2.Time consuming, and bandwidth heavy. Requires generating and uploading bulky war file during every deployment, even when the change is very small. 3.The WAR will deploy even if the test cases weren't all passing. This leads to defective application running in production.
  3. 3. The Auto deployment way 1. Commit the change in version control in desired branch. What problems does it solve? 1.Version controlled. Any branch/version can be deployed anytime. 2.Only difference (changes) get committed to version control repository. 3.Test cases are run automatically during deployment. If test cases fail, build fails, and the application isn't deployed. 4.Deployment happens automatically on commit (if configured so).
  4. 4. About the Application Simple JSF (CDI) application created on NetBeans using Maven archetype weld-jsf-jee. Tools used for auto-deployment setup 1.Apache Maven 2.Git/GitHub (Options: Bitbucket, Assembla, Install gitolite/gitosis) 3.Jenkins CI 4.Glassfish server 5.Git Bash (For command line interface to Git remote repository) 6.Amazon EC2 Instance (On Ubuntu 12.04 LTS 64 bit)
  5. 5. Three components: 1.Client Machine 2.Git Repository 3.Server Instance
  6. 6. Client Machine:  JSF (CDI) project created on NetBeans  The project has Junit test cases.  Uses Maven  Project is git initialized and points to remote github repository. Sample project:
  7. 7. Git Repository:  The code repository resides here (GitHub in this case).  Changes committed from client machine are reflected here.  Server Instance polls git repo for changes periodically.
  8. 8. Server Instance on Amazon EC2  IP:  Running Ubuntu 12.04 LTS.  Installed applications: Jenkins (Also the plugin: Deploy Plugin), Maven, Git, Jdk1.8, Glassfish  If any changes are pushed to Git repository, Jenkins will automatically PULL the changes, BUILD the project, TEST the project, and if successful, DEPLOY the project to Glassfish. It can be made to send emails on BUILD SUCCESS, BUILD FAILURE and successful deployment.
  9. 9. Sequence of Events Action Changes are merged and pushed to git. Internal chain of events ●Changes happen in remote git repo on Github ●Jenkins PULLs changes using Git ●Jenkins BUILDs project using Maven ●Jenkins TESTs changes using Maven ●Jenkins DEPLOYs project to Glassfish ●Jenkins sends out emails Result ●The changes are deployed. ●Emails are received notifying about Build/Deployment success/failure.
  10. 10. References: 1. Setting up a JSF Maven project in NetBeans (including working autocompletion for JSP/JSF) 2. NetBeans Maven Best Practices - Installing section 3. Get running on CDI & JSF 2 in a jiffy using Maven archetypes 4. Weld maven archetype (weld-jsf-jee) for creating a Java EE 6 application using JSF 2.0, CDI 1.0, EJB 3.1 and JPA 2.0 (persistence unit included) 5. weld-jsf-jee (Github) 6. Pre-configured, ready to run image for running Jenkins on Amazon EC2 7. Glassfish Ubuntu 12.04 Ubber Quick Install Guide
  11. 11. Questions?