61
www.ics.ug #icsug Getting started with Bluemix and custom development Oliver Busse, 27.03.2015

Out of the Blue: Getting started with IBM Bluemix development

Embed Size (px)

Citation preview

Page 1: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Oliver Busse, 27.03.2015

Page 2: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Oliver Busse

• „Bleeding Yellow“ since R4.5• Certified Lotus Instructor since 2001• IBM Champion for ICS in 2015• OpenNTF Contributor & Board Member• XPages Advocate• Framework-addict• IBM Bluemix beginner

www.oliverbusse.eu@zeromancer1972

Page 3: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Focus

This is NOT about coding(last chance to leave)

This demonstrates thepossible WORKFLOWS for developers using IBM Bluemix

Page 4: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Agenda

• What is…?

• Prerequisites

• Which tools?

• Getting started: your first application

• Which workflow?

– A: Start in Bluemix, continue on local

– B: Start local, deploy on Bluemix

Page 5: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

What is…• Bluemix

– PaaS („Platform as a Service“, 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

Page 6: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Prerequisites

• Create a new account or log in to your Bluemix account

Page 7: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Which tools?• Git-SCM

– common source code control system

• CMDER– Powerful command line replacement with Git support

• Any Editor (Notepad++, SublimeText, Brackets)

• 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

Page 8: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Create a new application(DEMO)

skip

Page 9: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Create a new application

Page 10: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Cont‘d: create a new application

Name your application.This will be the subdomain URL.

Choose „WEB“ for this first timer

Page 11: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Choose a runtime

Page 12: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Start coding: download starter code

Page 13: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Add a service

Page 14: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Alternative: use a Boilerplate

• Choose a Boilerplate from the catalog

• A Boilerplate is a predefined runtime with one or more services attached automatically

• A Boilerplate can also be edited later

• It‘s the easiest way to start over with a complete application structure

Page 15: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Cont‘d: use a Boilerplate

Page 16: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Workflow A:Start on Bluemix,continue on local

(DEMO)

Page 17: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Example: Visual Recognition in Node.js

Page 18: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Add the Visual Recognition Service

Page 19: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Cont‘d: adding the service

Page 20: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Start and open the application

We will change this later!

Page 21: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Start coding: add a repository*

*) You may have to create an account for JazzHub, too

Page 22: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Add the sample application to your repo

Page 23: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Goto your repo and browse or edit codeD

evO

ps

Page 24: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Clone your repo

• Learn Git!• Create a folder for your

repos• Open a command line

(e.g. CMDER)

Page 25: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Next steps

• Open the local project in your IDE

• Start coding!

Page 26: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Optional: use the sample app• Optional: Download the sample app (is this case the „Visual Recognition

Starter App“)

• Extract the sample app in your project folder (overwrite files if necessary)

Page 27: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Cont‘d: Next steps

• Commit & push changes with Git to your remote repository

Page 28: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Cont‘d: Next steps

• Watch DevOps building & deploying your application in the Cloud

Page 29: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Finished!• Watch your changes online on IBM Bluemix!

Voila!

Page 30: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Useful resources

• DevOps Repo: https://hub.jazz.net/project/<username>/<projectname>/overview

• DevOps Build & Deploy: https://hub.jazz.net/pipeline/<username>/<projectname

Page 31: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Workflow B:Start local,

deploy on Bluemix(DEMO)

Page 32: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Example: Java Web Application

• Ingredients:

– Eclipse IDE

– Bluemix Plugin for Eclipse

– Websphere Liberty Profile (WLP)

– CF-Tool

• Topics covered

– manifest.yml

– local build tools

– .war file

Page 33: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Setting up Eclipse: install Bluemix plugin

Page 34: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Cont‘d: install Bluemix plugin

• In Eclipse Marketplace, search for „bluemix“and hit enter.

• Find „IBM Eclipse Tools for Bluemix“ and hit „Install“.

• Follow the installer‘s instructions.

Page 35: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Setting up Eclipse: install WLP runtime• In Eclipse, goto

Window, Preferences, Server, Runtime Environments. Click „Add...“.

• Choose IBM, Websphere Application Server Liberty Profile.

• Click „Next“.

Page 36: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Cont‘d: install WLP runtime

• On the next screen choose „Install from an archive or a repository“ if you don‘t already have a WLP installed.

• Click „Next“.

Page 37: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Cont‘d: install WLP runtime• On the next screen browse for a

destination folder for the WLP installation.

• Choose „Download and Install...“.• The search for the WLP repos can

take some time.• Then, choose the „Liberty Profile

V8.5.5.4 Runtime“ (or newer, not the beta).

• Hit „Next“, then accept the license terms.

• Click „Next“.

Page 38: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Cont‘d: install WLP runtime

• Almost done!• Leave the settings alone and click

„Finish“.

Page 39: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Verify WLP installation• Open Window, Show

View, Servers to open the servers tab.

• The WLP should appear right below the IBM Bluemix runtime

Page 40: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

http://localhost:9080/

Page 41: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Test WLP installation• Create a new project• File, New, Project... „Dynamic Web

Project“

Page 42: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Cont‘d: Test WLP installation

Page 43: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Cont‘d: Test WLP installation• Create a sample jsp file „index.jsp“• Add the project to the WLP

runtime

Page 44: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Cont‘d: Test WLP installation

• Start the server and navigate to the URL in a browser

Page 45: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Next step: deploying on Bluemix

• Right-click on the IBM Bluemix Runtime entry in theservers tab

• Be sure to NOT have a manifest.yml file

• Choose „Add and remove...“

• Select your project

• Click „Add“, then „Finish“

Page 46: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Cont‘d: deploying on Bluemix• Set options for the Bluemix app, e.g. a host URL• These settings are optional• Check „Save to manifest file“• Click „Finish“

Page 47: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Cont‘d: deploying on Bluemix

• Check the console and your Bluemix dashboard!

Voila!

Page 48: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Alternative: using the CF-Tool

• Prerequesites

– manifest.yml

– WAR file in the project

Page 49: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Build application: WAR file

Page 50: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Cont‘d: Build application: WAR file

Page 51: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Cont‘d: Build application: WAR file

Page 52: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Deployment: manifest.yml

• If there is no manifest.yml file create a new one in the root folder of the project

• Contents:

applications:- name: ICSUGDemomemory: 512Minstances: 1host: icsugdemopath: ICSUGDemo.wardomain: mybluemix.net

Page 53: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

The CF Tool

Page 54: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Using the CF Tool• Open a command line

• Set the API entry point

• Set your target (default: „dev“)

• Login to Bluemix

Page 55: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

• Push the app to Bluemix

• Wait until you see that the app has started

Page 56: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Cont‘d: Using the CF Tool• Verify that the app is running

Page 57: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Summary

• Easy to start

• Easy to maintain

• Many options & tools

• A „developer‘s playground“

Page 58: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Coming soon! Follow #OpenNTF

Page 59: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Questions?

Page 60: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Thank you!

Page 61: Out of the Blue: Getting started with IBM Bluemix development

www.ics.ug #icsug

Getting started with Bluemix and custom development

Sourceshttp://bliker.github.io/cmder/

http://eclipse.org

http://bluemix.net

http://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/doc/visual-recognition/#using

http://thoughtsoncloud.com/2014/08/three-tools-work-ibm-bluemix/

https://github.com/cloudfoundry/cli#downloads

http://marketplace.eclipse.org/content/ibm-eclipse-tools-bluemix