An open API service indexing awesome lists of open source software.

https://github.com/deanpcmad/buildkiterb

Ruby library for the Buildkite API
https://github.com/deanpcmad/buildkiterb

Last synced: about 1 month ago
JSON representation

Ruby library for the Buildkite API

Awesome Lists containing this project

README

        

# BuildkiteRB

BuiltkiteRB is a Ruby library for the Buildkite API.

## Installation

Add this line to your application's Gemfile:

```ruby
gem "buildkiterb"
```

## Usage

### Set Client Details

Firstly you'll need to create an API Token on [Buildkite](https://buildkite.com/user/api-access-tokens)
and then configure it like below.

Buildkite tokens are created for a single organization now, so I recommend setting the `org` the same way,
to tidy up your code.

You can optionally set a pipeline too.

```ruby
Buildkite.configure do |config|
config.token = ENV["BUILDKITE_TOKEN"]
config.org = ENV["BUILDKITE_ORG"]
config.pipeline = ENV["BUILDKITE_PIPELINE"]
end

```

### Access Token

```ruby
# Get details of the current token
Buildkite::AccessToken.retrieve

# Revoke the current token
Buildkite::AccessToken.revoke
```

### Organizations

```ruby
# Retrieves an organization
Buildkite::Organization.get slug: "my-org-slug"
```

### Pipelines

```ruby
# List all pipelines for an org
Buildkite::Pipeline.list
#=> #