script

package
v0.3.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultDockerNetworkMode = "bridge"
)

Variables

This section is empty.

Functions

func DockerHostname

func DockerHostname(d *Docker) string

DockerHostname returns empty string when Docker.NetworkMode is empty. DockerNetworkMode returns Docker.NetworkMode when it is not empty.

func DockerNetworkMode

func DockerNetworkMode(d *Docker) string

DockerNetworkMode returns DefaultNetworkMode when Docker.NetworkMode is empty. DockerNetworkMode returns Docker.NetworkMode when it is not empty.

func DockerTty

func DockerTty(d *Docker) bool

DockerTty returns true if the build should allocate a pseudo tty

func Inject

func Inject(script string, params map[string]string) string

Types

type Build

type Build struct {
	// Image specifies the Docker Image that will be
	// used to virtualize the Build process.
	Image string

	// Name specifies a user-defined label used
	// to identify the build.
	Name string

	// Script specifies the build and test commands.
	Script []string

	// Env specifies the environment of the build.
	Env []string

	// Hosts specifies the custom IP address and
	// hostname mappings.
	Hosts []string

	// Cache lists a set of directories that should
	// persisted between builds.
	Cache []string

	// Services specifies external services, such as
	// database or messaging queues, that should be
	// linked to the build environment.
	Services []string

	// White-list of Branches that are built.
	Branches []string

	Deploy        *deploy.Deploy       `yaml:"deploy,omitempty"`
	Publish       *publish.Publish     `yaml:"publish,omitempty"`
	Notifications *notify.Notification `yaml:"notify,omitempty"`

	// Git specified git-specific parameters, such as
	// the clone depth and path
	Git *git.Git `yaml:"git,omitempty"`

	// Docker container parameters, such as
	// NetworkMode and UserName
	Docker *Docker `yaml:"docker,omitempty"`
}

Build stores the configuration details for building, testing and deploying code.

func ParseBuild

func ParseBuild(data string) (*Build, error)

func ParseBuildFile

func ParseBuildFile(filename string, params map[string]string) (*Build, error)

func (*Build) MatchBranch

func (b *Build) MatchBranch(branch string) bool

func (*Build) Write

func (b *Build) Write(f *buildfile.Buildfile, r *repo.Repo)

Write adds all the steps to the build script, including build commands, deploy and publish commands.

func (*Build) WriteBuild

func (b *Build) WriteBuild(f *buildfile.Buildfile)

WriteBuild adds only the build steps to the build script, omitting publish and deploy steps. This is important for pull requests, where deployment would be undesirable.

type Context

type Context interface {
	Host() string
	Owner() string
	Name() string

	Branch() string
	Hash() string
	Status() string
	Message() string
	Author() string
	Gravatar() string

	Duration() int64
	HumanDuration() string
}

type Deployment

type Deployment interface {
	Write(f *buildfile.Buildfile)
}

type Docker

type Docker struct {
	// NetworkMode (also known as `--net` option)
	// Could be set only if Docker is running in privileged mode
	NetworkMode *string `yaml:"net,omitempty"`

	// Hostname (also known as `--hostname` option)
	// Could be set only if Docker is running in privileged mode
	Hostname *string `yaml:"hostname,omitempty"`

	// Allocate a pseudo-TTY (also known as `--tty` option)
	TTY bool `yaml:"tty,omitempty"`
}

Docker stores the configuration details for configuring docker container.

type Notification

type Notification interface {
	Set(c Context)
}

type Publish

type Publish interface {
	Write(f *buildfile.Buildfile)
}

Jump to

Keyboard shortcuts

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