Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

Latest commit

 

History

History
84 lines (58 loc) · 2.36 KB

README.md

File metadata and controls

84 lines (58 loc) · 2.36 KB

BigPanda

Build Status Dependency Status

A Ruby interface to the Big Panda API.

Installation

Add this line to your application's Gemfile:

gem 'big-panda'

And then execute:

$ bundle

Or install it yourself as:

$ gem install big-panda

Usage

Simple Usage:

require 'big_panda'

panda = BigPanda::Client.new(access_token: 'my-access-token')
# => #<BigPanda::Client:0x007f8a39a07038 @target_url="https://api.bigpanda.io", @access_token="my-access-token">

panda.start_deployment({ component: 'html-editor', version: '123' })
# => {"status"=>"created", "id"=>"513382af21e4d3fc5800d01a"}

panda.finish_deployment({ component: 'html-editor', version: '123' })
# => {"status"=>"created", "id"=>"5133831091ad50246f00f089"}

Advanced Usage:

require 'big_panda'

panda = BigPanda::Client.new(access_token: 'my-access-token')
# => #<BigPanda::Client:0x007f8a39a07038 @target_url="https://api.bigpanda.io", @access_token="my-access-token">

panda.start_deployment({ component: 'html-editor', version: '123',
                         timestamp: Time.now.to_i, description: 'Deploying new version',
                         owner: 'Gregory Man', env: 'Production', source: 'chef',
                         hosts: ['a1.wix.com', 'a2.wix.com']
                       })
# => {"status"=>"created", "id"=>"51338369b4a7ea843100ceb3"}


panda.finish_deployment({ component: 'html-editor', version: '123',
                          timestamp: Time.now.to_i, status: 'failure', errorMessage: 'Ooops',
                          hosts: ['a1.wix.com', 'a2.wix.com']
                        })
# => {"status"=>"created", "id"=>"513383e021e4d3fc5800d02d"}

SSL Options

You can pass ssl options to BigPanda::Client.new

BigPanda::Client.new(access_token: 'my-access-token', ssl: {ca_file: '/my/cert.pem'})

Avalible SSL options (same as in net/http):

:client_cert
:client_key
:ca_file
:ca_path
:verify_depth
:version

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request