Skip to content

Adding Build Status Badge

You can create build status badge url a pipeline and display it your project repository's README file or in any other document or website.

Overview

Build status badges are commonly used in project's README file or at issue trackers, other informative web documents of projects. You can easily create badge url from Razorops's Workflow page. By default badge displays the last built branch of project and you can choose any relavent branch as per requirements. Razorops allows to generate badge for specific formats as well.

A pipeline can have following status -

  • Passed
  • Skipped
  • Cancelled
  • Failed
  • Unknown

Supported Formats -

  • Image URL
  • Markdown
  • Textile
  • Rdoc
  • AsciiDoc
  • reStructuredText
  • pod

Generate Build Status Badge

To generate the build status badge, you need to visit your pipeline workflow page and know the following variables.

  • <PIPELINE_NAME> is the name of the pipeline created.
  • <BRANCH_NAME> is the branch of the repository to generate build status for.
Template:
    http://api.qa.razorops.com/apps/<PIPELINE_NAME>/badge.svg?branch=<BRANCH_NAME>

Example:
    http://api.qa.razorops.com/apps/hidden-river-467/badge.svg?branch=master
Template:
    [![Build Status](http://api.qa.razorops.com/apps/<PIPELINE_NAME>/badge.svg?branch=<BRANCH_NAME>)](http://api.qa.razorops.com/apps/<PIPELINE_NAME>/workflows)

Example:
    [![Build Status](http://api.qa.razorops.com/apps/hidden-river-467/badge.svg?branch=master)](http://api.qa.razorops.com/apps/hidden-river-467/workflows)
Template:
    !http://api.qa.razorops.com/apps/<PIPELINE_NAME>/badge.svg?branch=<BRANCH_NAME>!:http://api.qa.razorops.com/apps/<PIPELINE_NAME>/workflows

Example:
    !http://api.qa.razorops.com/apps/hidden-river-467/badge.svg?branch=master!:http://api.qa.razorops.com/apps/hidden-river-467/workflows
Template:
    {<img src="http://api.qa.razorops.com/apps/<PIPELINE_NAME>/badge.svg?branch=<BRANCH_NAME>" alt="Build Status" />}[http://api.qa.razorops.com/apps/<PIPELINE_NAME>/workflows]

Example:
    {<img src="http://api.qa.razorops.com/apps/hidden-river-467/badge.svg?branch=master" alt="Build Status" />}[http://api.qa.razorops.com/apps/hidden-river-467/workflows]
Template:
    image:http://api.qa.razorops.com/apps/<PIPELINE_NAME>/badge.svg?branch=<BRANCH_NAME>["Build Status", link="http://api.qa.razorops.com/apps/<PIPELINE_NAME>/workflows"]

Example:
    image:http://api.qa.razorops.com/apps/hidden-river-467/badge.svg?branch=master["Build Status", link="http://api.qa.razorops.com/apps/hidden-river-467/workflows"]
Template:
    .. image:: http://api.qa.razorops.com/apps/<PIPELINE_NAME>/badge.svg?branch=<BRANCH_NAME>
                  :target: http://api.qa.razorops.com/apps/<PIPELINE_NAME>/workflows

Example:
    .. image:: http://api.qa.razorops.com/apps/hidden-river-467/badge.svg?branch=master
                  :target: http://api.qa.razorops.com/apps/hidden-river-467/workflows
Template:
    =for html <a href="http://api.qa.razorops.com/apps/<PIPELINE_NAME>/workflows"><img src="http://api.qa.razorops.com/apps/<PIPELINE_NAME>/badge.svg?branch=<BRANCH_NAME>"></a>

Example:
    =for html <a href="http://api.qa.razorops.com/apps/hidden-river-467/workflows"><img src="http://api.qa.razorops.com/apps/hidden-river-467/badge.svg?branch=master"></a>
Template:
    http://api.qa.razorops.com/apps/<PIPELINE_NAME>/badge.svg?branch=<BRANCH_NAME>

Example:
    http://api.qa.razorops.com/apps/hidden-river-467/badge.svg?branch=master

Shield Style

To use different style for the badge, you can opt to use Shield styles as well. Pass the param style=shield as a query param to the url as follow:

  Template:
    http://api.qa.razorops.com/apps/<PIPELINE_NAME>/badge.svg?branch=<BRANCH_NAME>&style=shield

  Example:
    http://api.qa.razorops.com/apps/hidden-river-467/badge.svg?branch=master&style=shield

Razorops styles

Build passed Build failed Build cancelled Build skipped Build unknown