Continuous delivery is awesome. Nothing beats the ease of delivering code and having your entire pipeline kick off, updating your application, without you having to do anything.

Bluemix makes this easy to do.

Configuring a pipeline with Bluemix and GitHub is split in two parts - creating an IBM Devops project, and configuring your pipeline. Creating the Devops project is as simple as clicking a few buttons and linking your Bluemix project to a GitHub repo. Configuring your pipeline is as simple as adding a few stages and jobs that feed in to each other.

There are a lot of screenshots in this post, but fear not - they’re here to make things easier to explain, not because this is a difficult process.

Prerequisites:

  1. A Bluemix account
  2. An IBM Devops account
  3. A Github account
  4. Create a Bluemix Project
  5. Push that project’s code to a Github Repo

Part 1: Configure your Devops project.

Navigate on over to IBM Devops, and click “Create Project”

create

Name your project and click on “link to an existing GitHub repository.” By convention, I prefer to name my IBM Devops project the same name as my Bluemix project.

link

Select the repo that contains the code for your project.

select

Now it’s project configuration time. For the purposes of this demo, we’re going to make it private and without scrum development tools.

Make sure to select “Make this a Bluemix Project,” otherwise you won’t be able to push the updates. Select the proper organization and space that houses your application.

config

You should see a success notification. To get to the build pipeline view for “Part 2,” click the “build & deploy button.

success

For a sanity check, you can verify that the following webhook was added to your GitHub repo:

webhook

Part 2: Configure your build pipeline.

Full docs here.

In this example, we’re going to be creating two stages: test/build and deploy. The test/build stage is going to have three jobs - install dependencies, test, and build. The deploy stage will only have one job - deploy.

Let’s start by creating a stage - click “Add Stage.”

create stage

Name this stage “Test + Build.” Make sure that “Run jobs whenever a change is pushed to Git” is selected.

new stage

We’re going to add three “build” jobs:

new jobs

For the purposes of this demo, we’re going to use npm for our “Builder Type.” We also have our npm scripts configured such that test runs our tests, and build does our build.

builder type

Stage 1, “Install Dependencies” uses as a build script:

npm install

Stage 2, “Test” uses as a build script:

npm run test

Stage 3, “Build” uses as a build script:

npm run build

Now all we need to do is create our deploy stage (by clicking add stage again):

new deploy

And then create a deploy job in our deploy stage.

new deploy job

For both of these, I’ve always found the defaults to be sufficient.

Part 3: Relax.

Now every time you push to your GitHub repo, your pipeline will run.

voila