Atlassian has added a continuous integration service as a new feature to their GitHub Cloud product. It’s called GitHub Pipelines and it is similar to Travis CI for GitHub offering a nice integration for continuous integration/delivery pipelines for projects hosted on GitHub.

It’s still in the beta phase and requires a sign-up but nevertheless I’d like to demonstrate the current state of this service and how easy it is to add scripted pipelines to a project.

pipelines run details 1024x780
Figure 1. Details view for a pipeline run

Activating GitHub Pipelines

Activating pipelines for your GitHub repository is quite simple and Atlassian has provided detailed information in their documentation here.

Basically everything we need to to is ..

  • Sign-up for a beta account as long as GitHub Pipelines are still beta

  • Activate pipelines for your project

  • Provide a configuration file named bitbucket-pipelines.yml

That’s all .. this is what the new pipelines configuration panels look like in your project administration area.

bitbucket pipeline configuration 1024x780
Figure 2. Pipelines configuration in GitHub Cloud

Examples

To get a feeling how easy it is to set-up pipelines for your project, I’m providing two concrete projects with different requirements here.

Vert.x REST Service with rest-assured Integration-Tests using Gradle

For demonstration purpose, I’ve created a small RESTful web-service using Vert.x and I have added a simple integration-test using the rest-assured library.

In addition, I have chosen Gradle as the build tool for this small project here.

Steps

We want GitHub Pipelines to process the following steps each time, a commit is pushed in this project:

  • Create an environment with Java and Gradle installed and configured

  • Check-out our project from GitHub

  • Resolve the dependencies used there (Vert.x, rest-assured, JUnit and so on..)

  • Run the tests

YAML Config File

As Pipelines allow us to load every Docker image we want, our first step is to search DockerHub for images with Java and Gradle installed.

As a result of our search, we’re using the image qlik/gradle here so we’re saving our simple Pipelines configuration in YAML format in a file named bitbucket-pipelines.yml in the project’s root directory:

# using gradle as build tool ..
image: qlik/gradle

pipelines:
  default:
    - step:
        script:
          - gradle --version
          - gradle test

This is the corresponding view on GitHub:

pipeline configuration via yaml 1024x780
Figure 3. Pipelines YAML Configuration File

Pipelines Overview

In the new Pipelines overview all executions of our pipeline runs are displayed and lead to the detail view for each execution.

Overview of Pipelines run

pipeline run overview 1024x780

Pipelines Run Details

In this view, all information for each specific step of our pipeline is displayed in detail and a download of the log-files in a raw-format is possible.

pipelines run details1 1024x780
Figure 4. Detail view for a specific Pipelines run

Pipelines Integration in Commits-View

Having pushed some commits to GitHub, we’re also able to see the result of the pipeline run for each commit in the commit overview.

pipelines in commits view 1024x780
Figure 5. Pipelines information added to the commits-view

JIRA Plugin running Tests with the Atlassian Plugin SDK

In the next example, I’m adding pipelines to an existing project, my Quick Subtasks Plugin for JIRA.

The tests in this plugin are run using JUnit, but Atlassian’s Plugin SDK is needed to build the project and run the tests here.

Steps

The steps we want run for this project are:

  • Create an environment with Java, Atlassian-Plugin-SDK (Maven) installed

  • Check out our project

  • Resolve dependencies needed (Atlassian’s JIRA API, JUnit and others..)

  • Run the tests

YAML Config File

Again we’re searching DockerHub for an image with the Atlassian Plugin SDK installed and we’re finally using translucent/atlassian-plugin-sdk as our designated Docker image.

image: translucent/atlassian-plugin-sdk

pipelines:
  default:
    - step:
        script:
          - atlas-version
          - atlas-mvn clean test

This is the corresponding view on GitHub:

quick subtasks pipelines configuration 1024x780
Figure 6. Pipelines configuration for the Quick Subtasks Plugin

Pipelines Overview

Again we see all pipelines run in the overview

quick subtasks pipelines overview 1024x780
Figure 7. Pipelines overview for the Quick Subtasks Plugin

Pipelines Run Details

In the Pipelines details we’re able to gather detailed information about the execution of our pipeline’s steps.

quick subtasks pipelines details 1024x780
Figure 8. Pipelines Details for the Quick Subtasks Plugin

Pipelines Integration in Commits-View

And finally an excerpt from the plugin’s commits view with an added pipelines status.

quick subtasks pipelines 1024x780
Figure 9. Pipelines status integration in the commit view

Tutorial Sources

Please feel free to download the tutorial sources from my Bitbucket repository for the Vert.x example, fork it there or clone it using Git:

git clone https://bitbucket.org/hascode/bitbucket-vertx3-pipeline.git