0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
This is a simple REST service to kick off bootstrap processes. It is intended for use in a VPC-type environment with limited access.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 2.3.3
>= 10.18.2
~> 1.6.7
>= 1.3.5
 Project Readme

SilverSpurs Build Status Gem Version Project Status: Abandoned – Initial development has started, but there has not yet been a stable, usable release; the project has been abandoned and the author(s) do not intend on continuing development.

RESTful Chef bootstrapping

Instead of using a CLI to kick off bootstrapping, hit an API endpoint and let the service do it for you.

Installation

Install chef and set up knife on the machine (refer to the chef docs)

Add this line to your application's Gemfile:

gem 'silver_spurs'

Create a config.ru:

require 'bundler'
Bundler.setup

require 'silver_spurs'

# SilverSpurs::App.deployment_key = '/opt/deployment_key.pem'
# SilverSpurs::App.deployment_user = 'deployer'
# SilverSpurs::App.node_name_filter = /\w{3,10}/
# SilverSpurs::Asyncifier.base_path = '/opt/silver_spurs'

run SilverSpurs::App    

And then execute:

$ bundle
$ rackup

Usage

Kick off a bootstrap

$ curl -X PUT -i -d node_name=machineotron http://localhost/bootstrap/10.0.1.2

The redirect will point to the query URL for the bootstrap run. Since these runs tend to take several minutes, this is preferable to a long-running HTTP request.

Further GET requests to this endpoint will return a log of the run in progress. HEAD requests will return just the status code.

Status codes

  • 406 - Missing a required parameter
  • 404 - Unknown endpoint or resource
  • 201 - Run completed successfully
  • 202 - Run in progress
  • 550 - Run ended in failure

Using the client

Add this line to the application's Gemfile:

gem 'silver_spurs'

Sample application

require 'silver_spurs/client'

silver = SilverSpurs::Client.new('http://localhost')
bootstrap = silver.start_bootstrap('10.0.1.2', 'machineotron')
while bootstrap.status == :pending do
  sleep 10
end
puts bootstrap.log

Contributing

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