Get started with Bluemix and Bluemix DevOps Services using Node.js

Last modified: 21 April 2015

Time: 30 minutes


Learning objectives

  • Create an app in IBM® Bluemix™ by using the SDK for Node.js starter pack.
  • Create a Git repository for the app.
  • Push changes to the Git repository from the IBM® Bluemix™ DevOps Services Web IDE.

Before you begin

Sign up for DevOps Services. When you sign up, you'll create an IBM id, create an alias, and register with Bluemix.


Create an app with IBM Bluemix

Bluemix is an open-standards, cloud-based platform where you can build, manage, and run all types of apps: mobile, smart devices, web, and big data. The Bluemix capabilities include Java™, mobile back-end development, app monitoring, and features from ecosystem partners and open source, all through an as-a-service model in the cloud.

You can find helpful information on the Bluemix website:

To get started now, try this tutorial. You'll create an app and deploy it.

  1. Sign in to Bluemix. The Dashboard opens: Bluemix Dashboard The Dashboard shows an overview of the active Bluemix space for your organization. By default, the space is dev and the organization is the user name of the person who created the project. For example, if bob@example.com logs in to Bluemix for the first time, the active space is dev and the organization is bob@example.com. If you create more organizations or spaces in Bluemix, use the same ones as you follow the tutorials. Use the default selections.

  2. Click CREATE AN APP. For the kind of app that you are creating, click Web.

  3. For your starter, click SDK for Node.js. Review the docs and details, and then click CONTINUE.

  4. Name your app and then click FINISH. The name is a unique URL where you access your app. After a moment, the app starts. The app's Overview page opens and shows that the app is running. Bluemix Application tile

Now that your app is running, you can see and modify its code by using DevOps Services.


Set up Git integration and auto-deploy in DevOps Services

You can work with your app's code in many ways. For example, with auto-deploy, you can modify the code that runs in your app by pushing your changes to a Git repository. You can auto-deploy your code if you use the Build & Deploy capabilities of DevOps Services.

  1. To enable auto-deploy, go to your app's Overview page on the Bluemix Dashboard and click ADD GIT. A Git repository is created and is populated with example code and a deployed app. You might be prompted to enter your password to verify that DevOps Services can act on your behalf. Add Git button

  2. Make sure that the Populate the repository with the starter application package and enable build and deploy check box is selected. Create Git repo dialog You created a Git repository, populated it with the example code, and deployed the app. Git repo success message dialog

  3. Go to the app's Overview page and click EDIT CODE. Your new project opens in the web integrated development environment (Web IDE).
    CODE button


Push changes to the Git repository by using the Web IDE

The integrated Web IDE is based on the Eclipse Orion open-source project. Orion at Bluemix DevOps Services

You can edit files with syntax coloring support for multiple languages, including HTML, CSS, JavaScript, Ruby, and Python. For some languages, such as JavaScript, the Web IDE also supports syntax checking and code completion, both for standard language constructs and for the services that Bluemix provides. To use content assist, press Ctrl+Space. For example, this image shows code completion for the standard Node.js express module: Orion showing express completions

  1. In the directory, find a file to modify; for example, views/body.jade.

  2. Edit the file in the editor. Orion editing index

  3. Push the change by using the integrated Git support.

    a. From the leftmost menu, click the Git Repository icon.

    b. Select the changed file: Orion Git staging c. Add a commit message and commit the changes: Orion Git commit d. Push the changes: Orion Git push

  4. To verify that your code was deployed, click BUILD & DEPLOY and wait until you see an indication that the app was deployed again. In the Deploy stage, under LAST EXECUTION RESULT, click the URL link that is below the app's name. Clicking the web app's URL

Your update is shown. Our really cool app


Summary

You have a good overview of how to get started with Node.js in Bluemix and DevOps Services.

You saw how to create and run a Node.js web app by using Bluemix. With one click, you created a Git repository, populated it with example code, and automatically deployed the app. You changed the code and pushed the changes to the Git repository by using the Web IDE. Then, you automatically built and deployed your changes, checked the deployment status, and verified your changes.

Next steps

After you have completed this tutorial, learn more about testing your application as you develop by using Bluemix Live Sync.


Need help? Ask a question in the IBM Bluemix DevOps Services forum. Have feedback? Report a bug or share your idea in the IBM Bluemix DevOps Services project.

© Copyright IBM Corporation 2013, 2015.