Diese Präsentation wurde erfolgreich gemeldet.
Die SlideShare-Präsentation wird heruntergeladen. ×

Out of the Blue - the Workflow in Bluemix Development

Weitere Verwandte Inhalte

Ähnliche Bücher

Kostenlos mit einer 30-tägigen Testversion von Scribd

Alle anzeigen

Ähnliche Hörbücher

Kostenlos mit einer 30-tägigen Testversion von Scribd

Alle anzeigen

Out of the Blue - the Workflow in Bluemix Development

  1. 1. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.20151 Oliver Busse The Workflow in Bluemix Development “Out of the Blue”
  2. 2. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.20152 Promise No coding (Code? Yes, maybe) – but tools
  3. 3. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.20153 Agenda  Introduction  Glossary  Tools used  Start on Bluemix  Continue on your PC  XPages on Bluemix – the basics  Extending XPages with Plugins – on Bluemix
  4. 4. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.20154 Introduction Oliver Busse • „Bleeding Yellow“ since R4.5 • Certified Lotus Instructor since 2001 • IBM Champion for ICS in 2015 • OpenNTF Contributor Director • XPages Advocate • IBM Bluemix curious
  5. 5. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.20155 Glossary – what is…? • Bluemix? • PaaS (platform only, no software preconfigured, based on CloundFoundry) • a Runtime? • Environment in which your application will run • a Service? • Functionality for your application e.g. Database, Security, Watson or „Internet of Things“ • DevOps? • „Development & Operations“, tools for testing, building and deploying apps • JazzHub? • Repository for your application source code, issue tracking and documentation • a Stage? • block in DevOps‘ deployment process • a Pipeline? • combination of stages when deploying an application • the CF-Tool? • CloudFoundry command line tool, manage your application via the console
  6. 6. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.20156 Tools used in this presentation • Git-SCM • common source code control system • CMDER with inline Git • Powerful command line replacement with Git support • Eclipse • IDE for Java Developers • Bluemix Plugin • Deployment console for Eclipse on Bluemix • Websphere Liberty Profile (WLP) • Local application server runtime • CF Commandline Tool • CloudFoundry command for deploying apps • Extlib v14 / Bluemix plugin for Domino Designer
  7. 7. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.20157 Start on IBM Bluemix
  8. 8. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.20158 Start on Bluemix
  9. 9. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.20159 Choose application type „WEB“
  10. 10. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201510 Choose a runtime
  11. 11. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201511 Let Bluemix do the work…  Wait until the application is created  The following page shows some basic information about the runtime and lets you download a sample application code  You can download this code and start over with it  We don‘t download the starter code  We are creative for ourselves
  12. 12. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201512 Read the intro and scroll down
  13. 13. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201513 Add a Git repository
  14. 14. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201514 Don‘t use the starter code Uncheck this!
  15. 15. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201515 Check the repository You will also receive an email that tells you about your new repository on JazzHub
  16. 16. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201516 Edit code: with DevOps
  17. 17. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201517 Create and edit your code locally  The starter code give you a basic example of a project  DevOps code editors are versatile and flexible  Helps you to start over without installing anything on your PC • Editing your code with a local IDE is of course more convenient though • You can preview your changes much faster on your local server • You can use 3rd party tools and add-ons in your IDE but...
  18. 18. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201518 Clone the (empty) repository  Using the Git command line  The folder with the repository will be created automatically
  19. 19. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201519 Continuing on your local PC  Install/setup your IDE, e.g. Eclipse  Create a new or use an existing project  Make sure you place the project files in the prior created repository folder on your disk  For a simple JSP/JSF based web app you can also use my boilerplate https://bitbucket.org/zeromancer1972/bluemix-liberty-boilerplate
  20. 20. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201520 Verify project structure, use the project  Check the extracted files (overwrite files from the ZIP if you are asked for it)  Import the project into Eclipse  Download the IBM Bluemix plugin and the Websphere Liberty Runtime from Eclipse Marketplace  Test run the app on the local WLP server
  21. 21. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201521 Importing the project into Eclipse
  22. 22. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201522 Importing the project into Eclipse Notice the arrows in the folder tree. They say „hey, I am not up-to-date in the Git repository, yet“. The question marks say „hey, I am not part of the repo, yet – add me!“
  23. 23. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201523 Push changes to Bluemix  The imported project is a „change“ in the repository  You have to commit these changes to the repository  Then push the changes to Bluemix DevOps -A = Add just all changes -m = your commit message upload the commit to DevOps
  24. 24. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201524 Setting up the build and deploy pipeline Just hit the „play“ button as our demo is using ANT build*. For other configurations hit the gear icon *) ANT is the default build system in DevOps
  25. 25. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201525 Watch Bluemix DevOps doing the work Building process Deploying process All green – Finished!
  26. 26. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201526 Show log output during build and deployment Just click here to see a detailed log output
  27. 27. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201527 Log outputs during „staging“
  28. 28. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201528 Test the deployed app • Open the URL of your application • Remember: URLs for both data centers are different: • myapp.nybluemix.net (US) • myapp.eu-gb.mybluemix.net (UK) Continue to make changes and bring your app to „life“. Happy coding!
  29. 29. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201529 Continue on your PC
  30. 30. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201530 Using the Bluemix Eclipse plug-in  Get the plug-in and install it in your Eclipse IDE  Once you set it up you‘ll find the plug-in in the server tab in Eclipse  If the server tab isn‘t displayed then open it with „Window, Show View, Server“ or „Other“ and search for it  Usually you start with a new project and deploy without using the Bluemix browser UI
  31. 31. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201531 Setting up the Bluemix plug-in  Double click on the entry in the server tab to open the configuration* *) https://developer.ibm.com/wasdev/downloads/#asset/tools-IBM_Eclipse_Tools_for_Bluemix
  32. 32. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201532 Adding a complete new application to Eclipse  Get a sample project or create a new Java WLP project  If you use an existing project, import it into Eclipse  Add it to the IBM Bluemix plug-in (RMB, „Add and Remove“)  Setup application name and domain for the application  Check the console *) A simple JSP application can be found here: https://bitbucket.org/zeromancer1972/bluemix-word-counter/downloads
  33. 33. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201533 Add the application to the Bluemix plug-in
  34. 34. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201534 Setting application properties for Bluemix
  35. 35. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201535 Check the console This is what we are looking for!
  36. 36. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201536 Check the Dashboard A new application was created!
  37. 37. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201537 View the result
  38. 38. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201538 XPages on Bluemix
  39. 39. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201539 Preparations & Considerations  Update your Notes/Domino Designer to 9.0.1  Get the latest Extension Library (V14, August 2015)  Install the Extlib in DDE and on your local Domino server (updatesite recommended)  Think different: separate the design from the data • create a copy of your application that contains the design only on your local server  It‘s easier to start with an existing application • use the demo app or use your own!  And: remember the !! notation 
  40. 40. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201540 Architecture & Ingredients NSF Design XSP Runtime NSFNSF NSF Data Domino NoSQL Service
  41. 41. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201541 Preparations (continued)  Create a Domino NoSQL Service  Grab your Bluemix Notes-ID  Setup a location document for Bluemix  If you don‘t have access to your local server‘s certifier ID then create a separate local Domino server • cross-certify the Bluemix Notes-ID on this machine • always use the Bluemix Notes-Id during development  Or: use your default Notes-ID for development • sign the applications prior to deployment on Bluemix with the Bluemix Notes-ID
  42. 42. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201542 Creating the Domino NoSQL Service
  43. 43. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201543 Creating the Domino NoSQL Service
  44. 44. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201544 Gathering Domino‘s information & your ID Download the ID file Notice the NSF filename!
  45. 45. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201545 Deployment process: the data part  Test the connection to the Bluemix Domino server • It‘s name is „slaney/Bluemix“* under the IP you just saw • Just hit CTRL+O and type in the IP • A connection document will be created automatically   Create a copy of your data NSF on the Bluemix Domino server  Tweak the ACL  Create other web users via the Domino dashboard *) Texas Datacenter, in the UK Datacenter the server is named lagan/Bluemix
  46. 46. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201546 Hello, Domino
  47. 47. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201547 Current Restrictions  No access to names.nsf  No access to DDM  No access to log.nsf  No admin access, no console access  No authentication to names.nsf, just ?login  No replicas, just copies allowed
  48. 48. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201548 Outlook  Usage of DA  Usage of other LDAP services such as Domino and AD  Replicas  Cross-certification  On-prem access
  49. 49. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201549 Deployment process: the design part  Examine your XPages, Custom Controls and SSJS for static access to the „current“ database  Change all occurrences to a dynamic access to the data part of your application • use the Bluemix examples in the documentation • or: use a bean to compute server !! filepath to your data NSF (the „DAOBean“ *)  Recommended: separate design from data on your local development environment, too! *) http://openntf.org/XSnippets.nsf/snippet.xsp?id=daobean-for-xsp-on-bluemix
  50. 50. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201550 Intoducing the BluemixContext  New SSJS object / Java class to access the Bluemix environment  Provides the DataService object / class  The DataService object / class provides the server and filepath to the data NSF import com.ibm.xsp.bluemix.util.context.BluemixContext; import com.ibm.xsp.bluemix.util.context.BluemixContextManager; import com.ibm.xsp.bluemix.util.context.DataService; public class DAOBean { public String getBluemixFilepath(){ BluemixContext bc = BluemixContextManager.getInstance(); DataService ds = bc.getDataService(); String serverAndFilePath = ds.getServerName() + "!!" + ds.getAppPath(); return serverAndFilePath; } }
  51. 51. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201551 Example: modifying the document data source <xp:view xmlns:xp="http://www.ibm.com/xsp/core“ xmlns:xc="http://www.ibm.com/xsp/custom"> <xp:this.data> <xp:dominoDocument var="document1" formName="frmBookmark" databaseName="#{javascript:dao.getBluemixFilepath()}"> </xp:dominoDocument> </xp:this.data> … • Assuming that the DAOBean class is defined as „dao“ in faces- config.xml • You also should calculate the local server and filepath if not running on Bluemix
  52. 52. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201552 Deploying the design part  You can use the DDE Bluemix plug-in or  Deploy the application for yourself with the CF tool (aka what the DDE plugin does)
  53. 53. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201553 Use the DDE Bluemix plug-in
  54. 54. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201554
  55. 55. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201555 Use the CF tool to deploy (what the plug-in does)  Create a folder on your disk  Create a copy (or replica) of your design part database in that folder (DO NOT encrypt the local copy!)  Create a text file called manifest.yml • this is the key part!  Don‘t forget to set the web launch option to an XPage!  You should end up with something like this:
  56. 56. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201556 manifest.yml --- applications: - name: iconukdemo host: iconukdemo instances: 1 memory: 512M timeout: 180 buildpack: xpages_buildpack command: /app/launch_xpages_webcontainer env: APP_HOME_URL: /iconukdemo.nsf APP_PRELOAD_DB: iconukdemo.nsf APP_VERBOSE_STAGING: 1 services: - IBM XPages NoSQL Database-UK Name and hostname of your application that will be used on Bluemix The NSF filename on your disk The Domino NoSQL service on your Bluemix environment
  57. 57. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201557 CF tool: 3 steps Name it whatever you want (or use an existing applicartion name)
  58. 58. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201558 Check application health
  59. 59. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201559 Extending XPages with Plugins
  60. 60. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201560 Plug-in Examples  OpenNTF Domino API  Bootstrap for XPages  Extension Library Relational  ViewGrid  XPages DebugToolbar  …
  61. 61. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201561 A few steps  Create a folder in the deployment directory called shared-plugins  Download the extension  Unzip it until you find the plugins folder  Copy all JAR files to the folder shared-plugins  Upload the application with the CF tool
  62. 62. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201562 Observe the plug-in deployment
  63. 63. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201563 Resources  CMDER http://cmder.net/  Blank Liberty for Bluemix Boilerplate: https://bitbucket.org/zeromancer1972/bluemix-liberty- boilerplate/downloads  Eclipse: http://www.eclipse.org  IBM Bluemix: http://bluemix.net  Eclipse Bluemix Plugin: https://marketplace.eclipse.org/content/ibm-eclipse-tools-bluemix  XPages Extension Library: http://extlib.openntf.org  OpenNTF Domino API: http://www.openntf.org/main.nsf/project.xsp?r=project/OpenNTF%20Domino%20API  Domino NoSQL Service: https://www.ng.bluemix.net/docs/services/XPagesNoSQLDatabase/index.html#xpservice_portexisting  How-tos: http://XPag.es/?2022 and http://XPag.es/?2026  DAO Bean: http://openntf.org/XSnippets.nsf/snippet.xsp?id=daobean-for-xsp-on-bluemix  CF Tool: https://github.com/cloudfoundry/cli/releases  BB-8: http://www.sphero.com/starwars Thanks to the IBM Ireland XPages / Bluemix Development Team & Pete Janzen
  64. 64. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201564 Q & A
  65. 65. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201565 Visit our booth and attend our other sessions: • Tuesday, 10:20, Room 2 Matthew Fyleman - “Oranges are not the only fruit” • Tuesday, 13:30, Room 1 Simon Peek - „Need XPages apps fast? Need apps on Mobile devices? Don’t have XPages knowledge? We4IT brings you Aveedo!” Attend this session to win a BB-8 Sphero!
  66. 66. UKLUG 2012 – Cardiff, Wales @zeromancer1972 21.+22.09.201566 Nominate your IBM Champions http://XPag.es/?202A

×