bitrise
A simple API client for the Bitrise API.
Usage
$ npm install --save @lifeomic/bitrise
API
bitrise({ token })
Create a new client instance. token
is a personal access token.
const bitrise = require('@lifeomic/bitrise');
const client = bitrise({ token: 'some-token' });
bitrise.app({ slug })
Create an app object. slug
is the Bitrise app slug.
const bitrise = require('@lifeomic/bitrise');
const app = bitrise({ token }).app({ slug });
An app has the following attributes:
- slug — the app's unique identifier.
async app.triggerBuild(options)
Trigger a new build for the app. Supported options
include the following:
- commitHash — the hash of the commit to checkout of SCM. By default
the
master
branch is run. - workflow — the ID of the Bitrise workflow to run.
Returns a build
object representing the build that was started. A build has
the following attributes:
- appSlug — the slug of the application that the build is for.
- buildSlug — the unique ID of the build.
References:
async build.describe()
Get all attributes for a build.
References:
async build.follow()
Poll on the logs for a build and print them to stdout. An error will be thrown
if the build fails.
References:
async build.isFinished()
Returns true
if the build has completed execution (regardless of success or
failure). Returns false
otherwise. This is just a convenience method for
running build.describe()
and checking the finished_at
attribute.
References: