Upgrade to Pro — share decks privately, control downloads, hide ads and more …

JUDCon Brazil -- Building Spring JPA Applications on OpenShift

JUDCon Brazil -- Building Spring JPA Applications on OpenShift

JUDCon Brazil -- Building Spring JPA Applications on OpenShift

Shekhar Gulati

May 02, 2013
Tweet

More Decks by Shekhar Gulati

Other Decks in Programming

Transcript

  1. WHO AM I? • Shekhar Gulati • OpenShift Developer Evangelist

    • Java / NoSQL/ Cloud • Twitter Handle : shekhargulati • Github https://github.com/shekhargulati • Slides https://speakerdeck.com/shekhargulati
  2. WHAT WILL YOU LEARN? • What is PaaS • What

    is OpenShift • Spring JPA Support • How to use OpenShift for deployment
  3. ASSUMPTIONS • You want to learn how to use OpenShift

    • You can write or read Java • You have your own laptop • You will ask questions
  4. “How do I use this?” Servers in the Cloud You

    must build and manage everything (OS, App Servers, DB, App, etc.) IaaS
  5. “I’m not sure this does what I need.” You are

    restricted to the features of the 3rd Party application Someone else’s app in the Cloud (CRM, etc.) SaaS
  6. • Quickly build the Application that YOU need for •

    Your Group, your Enterprise, your next great idea! • Big data, mobile, social • You code the application, We run it for you • Leverage the ease, scale and power of the Cloud Code Deploy Enjoy PaaS
  7. 13 Cloud Service Models STORAGE (RHS) HARDWARE (x86, Power, S/390)

    VIRTUALIZATION (RHEV) OPERATING SYSTEM (RHEL) APPLICATION PLATFORM (JBOSS, PHP, RUBY, ETC) APPLICATION Automated and Managed by the Public or Private Cloud Offering Managed and Controlled by Customer (IT, Dev, or User) IaaS PaaS SaaS Increased Control Increased Automation
  8. 21  OpenShift is free-as-in-beer & free-as-in-freedom  You get

    three free gears, each with 512MB memory and 1GB of disk space.  Need more resources, just ask!  The catch is we are in developer preview right now WHAT I GET
  9. 22 ➢ Login to OpenShift web console ➢ Click on

    “My Account” ➢ Namespace – judconbr13 – Unique per user CREATING NAMESPACE
  10. 24 Install Ruby 1.8.7 or greater Install Git Install rhc

    OpenShift gem Refer to https://www.openshift.com/developers/rhc-client-tools-install INSTALLING CLIENT TOOLS
  11. 27  PostgreSQL  OpenShift  Java 7 – Spring

    Framework – Spring Data JPA  GIT  SSH TECHNOLOGY CHOICES
  12. 28 rhc app create forumapp tomcat-7 postgresql-8.4 STEP 0 CREATE

    APPLICATION http://forumapp-t20.rhcloud.com/
  13. 29 ➢ Git repository ➢ Maven based project ➢ OpenShift

    profile in pom.xml ➢ The src folder – source code deployment ➢ The webapps folder – binary deployment ➢ The .openshift folder ➢ action_hooks – scripts to hook into application lifecycle ➢ config – overriding tomcat 7 configuration ➢ cron – run scripts or jobs on periodic basics ➢ markers – set of files for enabling and disabling features LOOK AT STEP 0
  14. 30 $ git rm -rf src pom.xml $ git commit

    -am “deleted template project” $ git remote add upstream -m master https://github.com/shekhargulati/forumapp.git $ git pull -s recursive -X theirs upstream master $ git checkout 3e8b88198bd981c27db562b8fd970beb05373f2b STEP 1 BASIC SETUP