Giter Club home page Giter Club logo

boo's Introduction

Boo

The purpose of Boo is to provide a simple command-line tool for the OneOps developers and OneOps users to deploy, update, destroy and operate their OneOps assemblies.

For the OneOps pack developers, it provides a fast and repeatable way to run tests against complex OneOps packs. For example, it allows a pack developer to use a short, one-line bash command to verify a parameter or code changes in an OneOps pack by attemping to instantiate the updated pack and executing tests on the resulting functional cluster. For an OneOps user, it provides an command-line tool to deploy, update, destroy and operator their OneOps assemblies. The boo tool is an addition to the OneOps UI interfaces.

Usage

To use Boo you download the executable JAR and place it in your $PATH. Use the latest version available from http://repo1.maven.org/maven2/com/oneops/boo/boo e.g.:

curl -O http://repo1.maven.org/maven2/com/oneops/boo/boo/1.0.5/boo-1.0.5-executable.jar

chmod +x boo-1.0.5-executable.jar

mv boo-1.0.5-executable.jar boo

boo <options>

To see what options are available for use:

boo -h

Configuration

Boo YAML templates are processed with Mustache to allow variable interpolation when the standard ~/.boo/config file contains a default profile. If you have a default profile that looks like the following:

[default]
host=https://localhost:9090
organization=devtools
api_key=oneops_api_key # copy from OneOps UI->profile->authentication->API Token
[email protected]
cloud=prod-cdc6

With a Boo YAML template that looks like this:

boo:
  oneops_host: '{{host}}'
  organization: '{{organization}}'
  api_key: '{{api_key}}'
  email: '{{email}}'
  environment_name: 'dev'
  ip_output: 'json'
  clouds:
    {{cloud}}:
       priority: '1'
       dpmt_order: '1'
       pct_scale: '100'

...

It will yield the following:

boo:
  oneops_host: 'https://localhost:9090'
  organization: 'devtools'
  api_key: 'oneops_api_key'
  email: '[email protected]'
  environment_name: 'dev'
  ip_output: 'json'
  clouds:
    prod-cdc6:
       priority: '1'
       dpmt_order: '1'
       pct_scale: '100'

...

If you want to see what your Boo YAML template will look like with interpolated values you can use the following command:

boo -f boo.yml -v

Inlining File Content

You can use the file directive to inline content into a Boo template. The following are examples of how you can inline the content of files:

{{file(./id_rsa.pub)}}
{{file(~/.ssh/id_rsa.pub)}}
{{file(/Users/jvanzyl/id_rsa.pub)}}

So, for example, if you wanted to inline the content of your public SSH key into your Boo template before execution you can do the following:

user:
  user-jvanzyl:
    system_account: true
    sudoer: true
    username: 'jvanzyl'
    description: "JvZ"
    authorized_keys: '["{{file(~/.ssh/id_rsa.pub}})"]'

The result will look something like:

user:
  user-jvanzyl:
    system_account: true
    sudoer: true
    username: 'jvanzyl'
    description: "JvZ"
    authorized_keys: '["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7g6cjv8yxH0pbo..."]'

Again, you can see what the result will be using boo -f your.yml -v.

Development

Build the source code to an executable command:

mvn clean package

chmod +x ./target/boo-1.0.5-executable.jar

mv ./target/boo-1.0.5-executable.jar boo

boo <options>

Build to an RPM

mvn clean package -Pbuild-rpms

Find the rpm at .//target/rpm/boo/RPMS/noarch/boo-1.0.5*.noarch.rpm

Install the RPM

On Linux: sudo rpm -ivh boo-1.0.5*.noarch.rpm
On Mac: sudo rpm -ivh boo-1.0.5*.noarch.rpm --nodeps

Running integration tests

The integration tests take some time to run as they spin up real assemblies, validate them and spin them down. To run the integration tests along with the tests use the following:

mvn clean verify -Pits

Note that in order to run the integration tests you also need a default profile in your ~/.boo/config that looks like the following:

[default]
host=https://localhost:9090
organization=oneops_org_name
api_key=oneops_api_key
[email protected]
cloud=cloud_name_in_oneops

Deploying SNAPSHOT

mvn clean deploy -P release

Releasing

Provided you have permissions to deploy to OSSRH with a serverId ossrh in your settings and the needed gpg setup you can build and deploy a release with

mvn release:prepare
mvn release:perform

And then just check and release the staging repo on https://oss.sonatype.org

Code style

Boo uses the Google code style. The formatter for Eclipse you can find here:

https://raw.githubusercontent.com/google/styleguide/gh-pages/eclipse-java-google-style.xml

boo's People

Contributors

jayeshpise avatar jvanzyl avatar khushbulohia avatar kkuser avatar mliu014 avatar mosabua avatar rayzhang123 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.