bosh-init

command module
v0.0.0-...-e2c346a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

README

BOSH Micro CLI Build Status

This is the BOSH Micro CLI rewritten to support external CPIs.

Usage

  1. Build micro:
bin/build
  1. Set up deployment manifest:
out/bosh-micro deployment manifest.yml
  1. Deploy
out/bosh-micro deploy stemcell.tgz cpi-release.tgz

where cpi-release.tgz is a BOSH CPI release and stemcell.tgz is a BOSH stemcell appropriate for the CPI release.

Please see the CLI workflow for more information on creating a manifest.

Logging

To output logs during bosh-micro commands set the BOSH_MICRO_LOG_LEVEL environment variable to one of the following values:

DEBUG, INFO, WARN, ERROR, NONE (default)

To output logs to a file set the BOSH_MICRO_LOG_PATH environment variable to the path of the file to create and/or append to.

By default (when BOSH_MICRO_LOG_LEVEL is not NONE) logs write to STDOUT (debug & info) & STDERR (warn & error).

Contributing

Set up a workstation for development

Note: This guide assumes a few things:

  • You have gcc (or an equivalent)
  • You can install packages (brew, apt-get, or equivalent)

Get Golang and its dependencies (Mac example, replace with your package manager of choice):

  • brew update
  • brew install go
  • brew install git (Go needs git for the go get command)
  • brew install hg (Go needs mercurial for the go get command)

Clone and set up the BOSH Micro CLI repository:

  • go get -d github.com/cloudfoundry/bosh-micro-cli
  • cd $GOPATH/src/github.com/cloudfoundry/bosh-micro-cli

From here on out we assume you're working in $GOPATH/src/github.com/cloudfoundry/bosh-micro-cli

To build the micro cli:

  • bin/build # The bosh-micro binary will be located in out/

Install tools used by the BOSH Micro CLI test suite:

  • bin/go get code.google.com/p/go.tools/cmd/vet
  • bin/go get github.com/golang/lint/golint
Running unit tests

Each package in the agent has its own unit tests and there are integration tests in the integration package. You can also run all tests with bin/test.

Running acceptance tests

Install sshpass:

  • brew install https://raw.github.com/eugeneoden/homebrew/eca9de1/Library/Formula/sshpass.rb

Acceptance tests can be run in a VM with the following vagrant providers:

  • virtualbox
  • vmware_fusion
  • vmware_workstation
  • aws
Running tests using local provider

When using a local provider, you may choose to download both the bosh-warden-cpi-release and stemcell to a local directory to then be copied into the VM. To take advantage of this feature, export the following variables prior to running the tests (absolute paths are required):

  $ export BOSH_MICRO_CPI_RELEASE_PATH=/tmp/bosh-warden-cpi-9.tgz
  $ export BOSH_MICRO_STEMCELL_PATH=/tmp/bosh-stemcell-348-warden-boshlite-ubuntu-trusty-go_agent.tgz
  $ ./bin/test-acceptance-with-vm --provider=virtualbox
Running tests using AWS provider

When using the AWS provider, you will need to provide the following:

  $ export BOSH_MICRO_PRIVATE_KEY=/tmp/id_rsa

  # The following variables are required by Bosh Lite
  $ export BOSH_AWS_ACCESS_KEY_ID=access_key
  $ export BOSH_AWS_SECRET_ACCESS_KEY=secret
  $ export BOSH_LITE_KEYPAIR=keypair
  $ export BOSH_LITE_SECURITY_GROUP=sg-1234
  $ export BOSH_LITE_PRIVATE_KEY=$BOSH_MICRO_PRIVATE_KEY
Running tests against existing VM

Acceptance tests use configuration file specified via BOSH_MICRO_CONFIG_PATH. The format of the configuration file is basic JSON.

{
  "vm_username": "TEST_VM_USERNAME",
  "vm_ip": "TEST_VM_IP",
  "private_key_path": "TEST_VM_PRIVATE_KEY_PATH",
  "cpi_release_path": "CPI_RELEASE_PATH",
  "cpi_release_url": "CPI_RELEASE_URL",
  "stemcell_path": "STEMCELL_PATH",
  "stemcell_url": "STEMCELL_URL"
}

Run tests:

BOSH_MICRO_CONFIG_PATH=config.json bin/test-acceptance

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/code.google.com/p/go.crypto/ssh
Package ssh implements an SSH client and server.
Package ssh implements an SSH client and server.
_workspace/src/code.google.com/p/go.crypto/ssh/agent
Package agent implements a client to an ssh-agent daemon.
Package agent implements a client to an ssh-agent daemon.
_workspace/src/code.google.com/p/go.crypto/ssh/terminal
Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems.
Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems.
_workspace/src/code.google.com/p/go.crypto/ssh/test
This package contains integration tests for the code.google.com/p/go.crypto/ssh package.
This package contains integration tests for the code.google.com/p/go.crypto/ssh package.
_workspace/src/code.google.com/p/gomock/gomock
GoMock - a mock framework for Go.
GoMock - a mock framework for Go.
_workspace/src/github.com/cloudfoundry/gosigar/psnotify
Go interface to the Linux netlink process connector.
Go interface to the Linux netlink process connector.
_workspace/src/github.com/nu7hatch/gouuid
This package provides immutable UUID structs and the functions NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4 and 5 UUIDs as specified in RFC 4122.
This package provides immutable UUID structs and the functions NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4 and 5 UUIDs as specified in RFC 4122.
_workspace/src/github.com/onsi/ginkgo
Ginkgo is a BDD-style testing framework for Golang The godoc documentation describes Ginkgo's API.
Ginkgo is a BDD-style testing framework for Golang The godoc documentation describes Ginkgo's API.
_workspace/src/github.com/onsi/ginkgo/config
Ginkgo accepts a number of configuration options.
Ginkgo accepts a number of configuration options.
_workspace/src/github.com/onsi/ginkgo/ginkgo
The Ginkgo CLI The Ginkgo CLI is fully documented [here](http://onsi.github.io/ginkgo/#the_ginkgo_cli) You can also learn more by running: ginkgo help Here are some of the more commonly used commands: To install: go install github.com/onsi/ginkgo/ginkgo To run tests: ginkgo To run tests in all subdirectories: ginkgo -r To run tests in particular packages: ginkgo <flags> /path/to/package /path/to/another/package To pass arguments/flags to your tests: ginkgo <flags> <packages> -- <pass-throughs> To run tests in parallel ginkgo -p this will automatically detect the optimal number of nodes to use.
The Ginkgo CLI The Ginkgo CLI is fully documented [here](http://onsi.github.io/ginkgo/#the_ginkgo_cli) You can also learn more by running: ginkgo help Here are some of the more commonly used commands: To install: go install github.com/onsi/ginkgo/ginkgo To run tests: ginkgo To run tests in all subdirectories: ginkgo -r To run tests in particular packages: ginkgo <flags> /path/to/package /path/to/another/package To pass arguments/flags to your tests: ginkgo <flags> <packages> -- <pass-throughs> To run tests in parallel ginkgo -p this will automatically detect the optimal number of nodes to use.
_workspace/src/github.com/onsi/ginkgo/internal/remote
Aggregator is a reporter used by the Ginkgo CLI to aggregate and present parallel test output coherently as tests complete.
Aggregator is a reporter used by the Ginkgo CLI to aggregate and present parallel test output coherently as tests complete.
_workspace/src/github.com/onsi/ginkgo/reporters
Ginkgo's Default Reporter A number of command line flags are available to tweak Ginkgo's default output.
Ginkgo's Default Reporter A number of command line flags are available to tweak Ginkgo's default output.
_workspace/src/github.com/onsi/gomega
Gomega is the Ginkgo BDD-style testing framework's preferred matcher library.
Gomega is the Ginkgo BDD-style testing framework's preferred matcher library.
_workspace/src/github.com/onsi/gomega/format
Gomega's format package pretty-prints objects.
Gomega's format package pretty-prints objects.
_workspace/src/github.com/onsi/gomega/gbytes
Package gbytes provides a buffer that supports incrementally detecting input.
Package gbytes provides a buffer that supports incrementally detecting input.
_workspace/src/github.com/onsi/gomega/gexec
Package gexec provides support for testing external processes.
Package gexec provides support for testing external processes.
_workspace/src/github.com/onsi/gomega/ghttp
Package ghttp supports testing HTTP clients by providing a test server (simply a thin wrapper around httptest's server) that supports registering multiple handlers.
Package ghttp supports testing HTTP clients by providing a test server (simply a thin wrapper around httptest's server) that supports registering multiple handlers.
_workspace/src/github.com/onsi/gomega/matchers
Gomega matchers This package implements the Gomega matchers and does not typically need to be imported.
Gomega matchers This package implements the Gomega matchers and does not typically need to be imported.
cmd
cpi
vm
job
pkg
set
ui

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL