Skip to content

magnumci/magnum-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

magnum-client

Ruby client library for Magnum CI API

Build Status Code Climate

Install

Add this line to your application's Gemfile:

gem "magnum-client"

And then execute:

bundle

Or install it yourself as:

$ gem install magnum-client

Usage

Require client:

require "magnum/client"

Authentication

Connection with existing API token:

client = Magnum::Client.new("api_token")

Authenticate user:

client = Magnum::Client.new
client.authenticate("email", "password")

User Profile

# Get user profile details
client.profile

#Update user profile
client.update_profile(login: "jimi", email: "[email protected]")

Projects

# Get projects
client.projects

# Get a single project
client.project(12345)

# Create a new project
client.create_project(
  name: "foobar",
  source_url: "[email protected]:foo/bar.git"
)

# Update existing project
client.update_project(
  name: "newname"
  source_url: "[email protected]:foo/bar.git"
  provider: "gitlab"
)

# Delete existing project
client.delete_project(12345)

Builds

project_id = 12345

# Get project builds
client.builds(project_id)

# Get a single build
client.build(project_id, 12345)

# Get build log
client.build_log(project_id, 12345)

# Delete a build
client.delete_build(project_id, 12345)

Commit Payloads

Send commit payload:

Magnum::Client.send_payload("project token", "data")

Testing

To run test suite execute:

bundle exec rake test

License

The MIT License (MIT)

Copyright (c) 2013-2014 Dan Sosedoff, [email protected]

Releases

No releases published

Packages

No packages published

Languages