Project

hula

0.01
Repository is archived
No release in over 3 years
Low commit activity in last 3 years
We were using cf and bosh command line clients in a lot of places, mostly specs, this should put an end to the crazy shell-ing
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

Hula

Hula is ruby client that provides two libraries wrapping the CF and BOSH cli.

It gives a way to programmatically manage your bosh manifest and bosh deployments with BoshDirector and BoshManifest. Similarly with CF, you can make use of the CloudFoundry class to call common CF CLI operations.

Installation

Add this line to your application's Gemfile:

gem 'hula'

And then execute:

$ bundle

Or install it yourself as:

$ gem install hula

Usage

CloudFoundry

A simple scenario of pushing a cf application and binding a service using Hula::CloudFoundry

  1. Instantiate a Cloudfoundry instance with correct args (domain, api_url etc..).
  2. Authenticate using the login method.
  3. Assuming an org/space, target your org and space using the target_org and target_space method respectively.
  4. Push your app with push_app.
  5. Assuming an already enabled service, use the bind_app_to_service method.
  6. Start your app with start_app.
cf = Hula::CloudFoundry.new(domain: 'my.cf.com', api_url: 'api.my.cf.com')
cf.login('admin', 'admin')
cf.target_org('org')
cf.target_space('space')
cf.push_app('./my-app', 'my-app')
cf.bind_app_to_service('my-app', 'my-service')

Bosh

You can use Hula::BoshDirector to deploy, run errands, get ips from jobs and more:

  1. Instantiate Hula::Bosh with your director information.
  2. Use deploy with a valid manifest to deploy it.
  3. Use run_errand to run the given errand specified in the manifest.
  4. Use ips_for_job to get all ips for a given job in the manifest.
bosh = Hula::BoshDirector(target_url: 'bosh_director_url', username: 'user',password: 'pass')
bosh.deploy('./manifests/manifest.yml')
bosh.run_errand('some_errand_name')
puts bosh.ips_for_job('job_name')

Contributing

  1. Fork it ( https://github.com/[my-github-username]/hula/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Add tests to your feature
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request