build

package
v0.0.0-...-4f682fb Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Build

type Build struct {
	ID         string       `bson:"_id"`
	Containers []*Container `bson:"containers"`
}

Build is the response to a setup.

type Container

type Container struct {
	ID          string `bson:"id"`
	VirtualHost string `bson:"virtualhost"`
}

Container is information about the containers in a build.

type Manager

type Manager struct {
	DockerClient  docker.Docker
	PluginManager *plugin.Manager
}

Manager is the build manager that creates docker networks and containers.

func New

func New(docker docker.Docker, pluginManager *plugin.Manager) *Manager

New initilizes a new build manager.

func (*Manager) ExecuteSteps

func (m *Manager) ExecuteSteps(ctx context.Context, buildID string,
	serviceName string, containerID string, steps []*types.Step)

ExecuteSteps runs the steps in the configuration for a single service.

func (*Manager) Setup

func (m *Manager) Setup(ctx context.Context, opts *Opts) (*Build, error)

Setup performs all the docker-related tasks to fire up a new build.

It creates a Docker network for the build to avoid communication between containers from different builds. It then creates the containers for the build and starts them.

type Opts

type Opts struct {
	Services []*types.Service

	// Used to generate the virtual host used by nginx-proxy for reverse proxy.
	VirtualHostSuffix string

	BuildID        string
	NetworkPreffix string
}

Opts is the configuration to crate a new build.

Jump to

Keyboard shortcuts

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