project

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2018 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DockerComposeVersion is the version of docker-compose used
	DockerComposeVersion = "docker/compose:1.21.0"

	// HerokuishVersion is the version of Herokuish used
	HerokuishVersion = "gliderlabs/herokuish:v0.4.0"

	// BuildStageName specifies the name of build stage containers
	BuildStageName = "build"
)

Variables

View Source
var (
	// ErrInvalidGitAuthentication is returned when handshake with a git remote fails
	ErrInvalidGitAuthentication = errors.New("git authentication failed")
)
View Source
var (
	// ErrNoContainers is the response to indicate that no containers are active
	ErrNoContainers = errors.New("There are currently no active containers")
)

Functions

func ContainerLogs added in v0.3.0

func ContainerLogs(cli *docker.Client, opts LogOptions) (io.ReadCloser, error)

ContainerLogs get logs ;)

func SimplifyGitErr

func SimplifyGitErr(err error) error

SimplifyGitErr checks errors that involve git remote operations and simplifies them to ErrInvalidGitAuthentication if possible

Types

type DeployOptions

type DeployOptions struct {
	SkipUpdate bool
}

DeployOptions is used to configure how the deployment handles the deploy

type Deployer

type Deployer interface {
	Deploy(*docker.Client, io.Writer, DeployOptions) error
	Down(*docker.Client, io.Writer) error
	Destroy(*docker.Client, io.Writer) error

	GetStatus(*docker.Client) (*common.DeploymentStatus, error)
	SetConfig(DeploymentConfig)
	GetBranch() string
	CompareRemotes(string) error
}

Deployer does great deploys

type Deployment

type Deployment struct {
	// contains filtered or unexported fields
}

Deployment represents the deployed project

func NewDeployment

func NewDeployment(cfg DeploymentConfig, out io.Writer) (*Deployment, error)

NewDeployment creates a new deployment

func (*Deployment) CompareRemotes

func (d *Deployment) CompareRemotes(remoteURL string) error

CompareRemotes will compare the remote of the deployment with given remote URL and return nil if they match

func (*Deployment) Deploy

func (d *Deployment) Deploy(cli *docker.Client, out io.Writer, opts DeployOptions) error

Deploy will update, build, and deploy the project

func (*Deployment) Destroy

func (d *Deployment) Destroy(cli *docker.Client, out io.Writer) error

Destroy shuts down the deployment and removes the repository

func (*Deployment) Down

func (d *Deployment) Down(cli *docker.Client, out io.Writer) error

Down shuts down the deployment

func (*Deployment) GetBranch

func (d *Deployment) GetBranch() string

GetBranch returns the currently deployed branch

func (*Deployment) GetStatus

func (d *Deployment) GetStatus(cli *docker.Client) (*common.DeploymentStatus, error)

GetStatus returns the status of the deployment

func (*Deployment) SetConfig

func (d *Deployment) SetConfig(cfg DeploymentConfig)

SetConfig updates the deployment's configuration. Only supports ProjectName, Branch, and BuildType for now.

type DeploymentConfig

type DeploymentConfig struct {
	ProjectName string
	BuildType   string
	RemoteURL   string
	Branch      string
	PemFilePath string
}

DeploymentConfig is used to configure Deployment

type LogOptions

type LogOptions struct {
	Container    string
	Stream       bool
	Detailed     bool
	NoTimestamps bool
}

LogOptions is used to configure retrieved container logs

Jump to

Keyboard shortcuts

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