Skip to content

Bluemix

patrikfr edited this page Oct 21, 2014 · 12 revisions

Bluemix by IBM

Deployment instructions for Bluemix by IBM

Blumix is IBM's implementation of the Cloud Foundry platform. It provides a free tier, making it a good place to start your PaaS journey!

Prerequisites

Deploy!

Install and configure Bluemix

Execute the following commands from the command line:

  1. cf api https://api.ng.bluemix.net to connect to the Bluemix API.
  2. Login to Bluemix: cf login -u <your-bluemix-id> -o <your-bluemix-id> -s dev This will log you in to your default organization and space, read more about organizations and spaces in the documentation. The CLI will prompt you for your password.

Build the application

Build and package the application.

Deploy the application to Bluemix

  1. Create a new working directory for Bluemix on a directory of your choice, we will refer to it as <notes-bm> below.
  2. Copy the ROOT.war from above to <notes-bm>/.
  3. Change dir: cd /path/to/<notes-bm>.
  4. Push the WAR-file as a new app. The name you give the app must be globally unique, so pick something good; replace with the name you choose: cf push <name-notes> -m 512m -p ROOT.war. This will upload the WAR-file and create the app, but it will not start correctly since there is no database. Let's fix that!
  5. Create the mongodb service: cf create-service mongodb 100 mongodb-notes
  6. Bind it to our new app: cf bind-service <name-notes> mongodb-notes
  7. Restart the application: cf restage <name-notes>

At this point the application will be restarted, watch console output to track progress.

BOOM! And you're done!

You should now be able to access the application at http://<notes-name>.mybluemix.net. Open the page in your web browser to view the application, and then, take some notes.

For further details of the platform, see the IBM Bluemix Docs.

It's also possible to create the services and upload the WAR file using the web GUI at http://blumemix.net.

Things to try out

  • Do a Blue/Green deployment for zero downtime
  • Attach a manifest.yml file with your deploy and bind to the MongoDB service, making it unnecessary to restart the application after your deploy.
  • Try deploy in one terminal window and tailing the logs in another (cf logs <notes-name> to see what is happening during deploy.
  • Login to the GUI at https://bluemix.net and try to recreate the deploy using the GUI.
Clone this wiki locally