KEMBAR78
Bluemix - Deploying a Java Web Application | PPTX
Deploying on Bluemix
Cloud Foundry / Java Web App
craigtrim@gmail.com
This is not an official IBM position. The views expressed are solely my own.
Create the Web App
• Simple JAX-RS Web app
• Given a URL in this format
• <host:port>/blog/rest/get?name=C
raig
• Return a result on the screen
• The structure of the web app is explained
here:
• http://trimc-
jee.blogspot.com/2015/01/an-
introduction-to-java-api-for-restful.html
Configure a build
script
• It’s going to be easier if we put our
Maven build configuration into a shell
script that can be called during the CF
deployment process
• My script is simple:
• mvn clean install
• Remember to make your script
executable
• chmod +x <script>
• Make sure the script works locally first
Configure a Manifest
Configure a
deployment script
• The ${CF_APP} env variable is passed in
automatically
• Specify the manifest we created on the
prior slide
Check your code into
the Jazz Hub
• http://www.slideshare.net/CraigTrim/ibm
-bluemix-creating-a-git-project
• http://www.slideshare.net/CraigTrim/ibm
-bluemix-building-a-project-with-maven
Build and Deploy
• We’re only going to add one stage that
combines both building and deploying
Input Configuration
• I prefer to invoke this deploy stage
manually
Add a Job
Configure the Deploy
Job
• Just invoke the two scripts we previously
created
• There is nothing to prevent us from doing
deep scripting within this web window
• But it’s easer to work with external files
• It’s likely I’ll only have to configure this
web dialog once
Save …
Deploy: Not yet run
• Here’s my pipeline
• Let’s go ahead and run the deployment
and see what happens …
• The stage can be manually invoked by
clicking the arrow in the upper right
Deploy: Pending
• Click “View logs and history”
Deploy: Running
• This is a running log file; scroll down to
view the input as the system invokes both
Maven and (if the build is successful)
proceeds to perform a Cloud Foundry
deployment
Deploy: Successful
Deploy: Successful
Test the URL
• Success!
Command Line
Interaction
• Install CF on the command line
• <link>
Login
View the logs
cf logs –recent jaxrs-simple

Bluemix - Deploying a Java Web Application

  • 1.
    Deploying on Bluemix CloudFoundry / Java Web App craigtrim@gmail.com This is not an official IBM position. The views expressed are solely my own.
  • 2.
    Create the WebApp • Simple JAX-RS Web app • Given a URL in this format • <host:port>/blog/rest/get?name=C raig • Return a result on the screen • The structure of the web app is explained here: • http://trimc- jee.blogspot.com/2015/01/an- introduction-to-java-api-for-restful.html
  • 3.
    Configure a build script •It’s going to be easier if we put our Maven build configuration into a shell script that can be called during the CF deployment process • My script is simple: • mvn clean install • Remember to make your script executable • chmod +x <script> • Make sure the script works locally first
  • 4.
  • 5.
    Configure a deployment script •The ${CF_APP} env variable is passed in automatically • Specify the manifest we created on the prior slide
  • 6.
    Check your codeinto the Jazz Hub • http://www.slideshare.net/CraigTrim/ibm -bluemix-creating-a-git-project • http://www.slideshare.net/CraigTrim/ibm -bluemix-building-a-project-with-maven
  • 7.
    Build and Deploy •We’re only going to add one stage that combines both building and deploying
  • 8.
    Input Configuration • Iprefer to invoke this deploy stage manually
  • 9.
  • 10.
    Configure the Deploy Job •Just invoke the two scripts we previously created • There is nothing to prevent us from doing deep scripting within this web window • But it’s easer to work with external files • It’s likely I’ll only have to configure this web dialog once
  • 11.
  • 12.
    Deploy: Not yetrun • Here’s my pipeline • Let’s go ahead and run the deployment and see what happens … • The stage can be manually invoked by clicking the arrow in the upper right
  • 13.
    Deploy: Pending • Click“View logs and history”
  • 14.
    Deploy: Running • Thisis a running log file; scroll down to view the input as the system invokes both Maven and (if the build is successful) proceeds to perform a Cloud Foundry deployment
  • 15.
  • 16.
  • 17.
  • 18.
    Command Line Interaction • InstallCF on the command line • <link>
  • 19.
  • 20.
    View the logs cflogs –recent jaxrs-simple