bob

package module
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2014 License: MIT Imports: 13 Imported by: 0

README

bob

Build Status GoDoc

💥 bob, the builder builds, tags, and pushes multiple Docker images, all from a friendly config file 💥

(by convention, the config file is named bob.toml)

IMPORTANT ANNOUNCEMENTS

Binary Availability

The binaries are NOT yet available. This message will be removed and the links below will be updated when the binaries have been published.

Project Status

This project is considered to be in "alpha" - that means that any releases should have basic functionality. However, you should expect that things may be buggy, broken, or simply changing quickly.

At this stage, the best way to stay up to date is to build from source. Binaries should be used mainly for testing proof-of-concept uses.

Builds can be done from the following sources:

Why?

  • base layers
  • can only add in one "Dockerfile"
  • can't easily exclude dirs / long file names (aufs limitation?)
  • generally make it more efficient to build in smaller layers to make pushing and pulling faster, easier, more reliable, etc

Installing

When the binaries are available, installing will look something like this:

# on Mac OS X
curl -sL https://github.com/rafecolton/bob/releases/download/0.0.1-alpha/darwin-amd64.tar.gz | \
  tar -xzf - -C /usr/local --strip-components=1
# on Linux, note: you may need sudo
curl -sL https://github.com/rafecolton/bob/releases/download/0.0.1-alpha/linux-amd64.tar.gz | \
  sudo tar -xzf - -C /usr/local --strip-components=1

Building Containers

Example usage:

# verify your bob.toml file is valid
builder --lint bob.toml

# build your containers
builder # default behavior: `--build bob.toml`
# or
builder --build <app-name>.toml

For other uses:

builder -h/--help

# Usage:
#   builder [OPTIONS]
# 
# Application Options:
#   -v             Print version and exit
#       --version  Print long version and exit
#       --branch   Print branch and exit
#       --rev      Print revision and exit
#   -q, --quiet    Produce no output, only exit codes (false)
#   -l, --lint=    Lint the provided file. Compatible with -q/--quiet
#   -b, --build=   The configuration file for Builder
# 
# Help Options:
#   -h, --help     Show this help message

Hacking

make help

# Usage: make [target]
#
# Options:
#
#   help/default: display this message
#
#   all: clean build test
#
#   quick: build + invokes builder a couple times (good for debugging)
#
#   build: gvm linkthis plus installing libs plus installing deps
#
#   test: build fmtpolice and ginkgotests
#
#   dev: set up the dev tool chain

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(source string, dest string) (err error)

CopyDir recursively copies one dir from source to dest. Copied from https://github.com/opesun/copyrecur.

func CopyFile

func CopyFile(source string, dest string) (err error)

CopyFile copies one file from source to dest. Copied from https://gist.github.com/elazarl/5507969 and modified.

Types

type Builder

type Builder struct {
	log.Logger

	Stderr      io.Writer
	Stdout      io.Writer
	Builderfile string
	// contains filtered or unexported fields
}

A Builder is the struct that actually does the work of moving files around and executing the commands that do the docker build.

func NewBuilder

func NewBuilder(logger log.Logger, shouldBeRegular bool) (*Builder, error)

NewBuilder returns an instance of a Builder struct. The function exists in case we want to initialize our Builders with something.

func (*Builder) Build

func (bob *Builder) Build(commandSequence *parser.CommandSequence) error

Build is currently a placeholder function but will eventually be used to do the actual work of building.

func (*Builder) CleanWorkdir

func (bob *Builder) CleanWorkdir() error

CleanWorkdir effectively does a rm -rf and mkdir -p on bob's workdir. Intended to be used before using the workdir (i.e. before new command groups).

func (*Builder) LatestImageTaggedWithUUID

func (bob *Builder) LatestImageTaggedWithUUID(uuid string) (string, error)

LatestImageTaggedWithUUID accepts a uuid and invokes the underlying utility DockerClient to determine the id of the most recently created image tagged with the provided uuid.

func (*Builder) Repodir

func (bob *Builder) Repodir() string

Repodir is the dir from which we are using files for our docker builds.

func (*Builder) SetNextSubSequence

func (bob *Builder) SetNextSubSequence(subSeq *parser.SubSequence)

SetNextSubSequence sets the next subsequence within bob to be processed. This function is exported because it is used explicitly in tests, but in Build(), it is intended to be used as a helper function.

func (*Builder) Setup

func (bob *Builder) Setup() error

Setup moves all of the correct files into place in the temporary directory in order to perform the docker build.

func (*Builder) Workdir

func (bob *Builder) Workdir() string

Workdir returns bob's working directory.

Directories

Path Synopsis
tag

Jump to

Keyboard shortcuts

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