core

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2015 License: MIT Imports: 21 Imported by: 16

Documentation

Index

Constants

View Source
const DefaultBranch = "master"
View Source
const LatestTag = "latest"

Variables

This section is empty.

Functions

func Critical added in v0.1.0

func Critical(ctx ...interface{})

func Debug added in v0.1.0

func Debug(ctx ...interface{})

func Error added in v0.1.0

func Error(ctx ...interface{})

func Info added in v0.1.0

func Info(ctx ...interface{})

func Warning added in v0.1.0

func Warning(ctx ...interface{})

Types

type Commit

type Commit string

type Container

type Container struct {
	DockerEndPoint string
	Image          ImageID
	docker.APIContainers
}

func (*Container) BelongsTo added in v0.1.0

func (c *Container) BelongsTo(p *Project) bool

func (*Container) GetPortsString

func (c *Container) GetPortsString() string

func (*Container) GetShortID added in v0.4.4

func (c *Container) GetShortID() string

func (*Container) IsRunning

func (c *Container) IsRunning() bool

type ContainersByCreated

type ContainersByCreated []*Container

func (ContainersByCreated) Len

func (c ContainersByCreated) Len() int

func (ContainersByCreated) Less

func (c ContainersByCreated) Less(i, j int) bool

func (ContainersByCreated) Swap

func (c ContainersByCreated) Swap(i, j int)

type Docker

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

func NewDocker

func NewDocker(endPoint string, env *Environment) (*Docker, error)

func (*Docker) BuildImage

func (d *Docker) BuildImage(
	p *Project, rev Revision, dockerfile *Dockerfile, output io.Writer,
) error

func (*Docker) Clean

func (d *Docker) Clean(p *Project) error

func (*Docker) Deploy

func (d *Docker) Deploy(p *Project, rev Revision, dockerfile *Dockerfile, output io.Writer, force bool) error

func (*Docker) ListContainers

func (d *Docker) ListContainers(p *Project) ([]*Container, error)

func (*Docker) ListImages

func (d *Docker) ListImages(p *Project) ([]*Image, error)

func (*Docker) Run

func (d *Docker) Run(p *Project, rev Revision) error

type DockerGroup

type DockerGroup struct {
	sync.WaitGroup
	// contains filtered or unexported fields
}

func NewDockerGroup

func NewDockerGroup(environment *Environment) (*DockerGroup, error)

func (*DockerGroup) BuildImage

func (d *DockerGroup) BuildImage(p *Project, rev Revision, dockerfile *Dockerfile, output io.Writer) []error

func (*DockerGroup) Clean

func (d *DockerGroup) Clean(p *Project) []error

func (*DockerGroup) Deploy

func (d *DockerGroup) Deploy(p *Project, rev Revision, dockerfile *Dockerfile, output io.Writer, force bool) []error

func (*DockerGroup) ListContainers

func (d *DockerGroup) ListContainers(p *Project) ([]*Container, []error)

func (*DockerGroup) ListImages

func (d *DockerGroup) ListImages(p *Project) ([]*Image, []error)

func (*DockerGroup) Run

func (d *DockerGroup) Run(p *Project, rev Revision) []error

type Dockerfile added in v0.1.0

type Dockerfile struct {
	Files []*File
	// contains filtered or unexported fields
}

func NewDockerfile added in v0.1.0

func NewDockerfile(content []byte, p *Project, r Revision, e *Environment) *Dockerfile

func (*Dockerfile) Get added in v0.1.0

func (d *Dockerfile) Get() []byte

type Environment added in v0.1.0

type Environment struct {
	DockerEndPoints []string `gcfg:"DockerEndPoint"`
	CertPath        string   `json:"-"`
	EtcdServers     []string `gcfg:"EtcdServer"`
	Name            string
	Host            string `gcfg:"Host"`
}

func (*Environment) String added in v0.1.0

func (e *Environment) String() string

type Etcd added in v0.1.0

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

func NewEtcd added in v0.1.0

func NewEtcd(endPoints []string) (*Etcd, error)

func (*Etcd) Get added in v0.1.0

func (e *Etcd) Get(key string) (string, error)

type Event added in v0.1.0

type Event string
var (
	EventDebug    Event = "log.debug"
	EventInfo     Event = "log.info"
	EventWarning  Event = "log.warning"
	EventError    Event = "log.error"
	EventCritical Event = "log.critical"
)

type EventManager added in v0.1.0

type EventManager struct {
	sync.Mutex
	// contains filtered or unexported fields
}
var Events *EventManager

func NewEventManager added in v0.1.0

func NewEventManager() *EventManager

func (*EventManager) Has added in v0.1.0

func (m *EventManager) Has(e Event, s *Subscriber) int

func (*EventManager) Subscribe added in v0.1.0

func (m *EventManager) Subscribe(e Event, s *Subscriber)

func (*EventManager) Trigger added in v0.1.0

func (m *EventManager) Trigger(e Event, ctx ...interface{})

func (*EventManager) Unsubscribe added in v0.1.0

func (m *EventManager) Unsubscribe(e Event, s *Subscriber)

type File added in v0.4.4

type File struct {
	Name    string
	Content []byte
}

type Github

type Github struct {
	sync.WaitGroup
	// contains filtered or unexported fields
}

func NewGithub

func NewGithub(token string) *Github

func (*Github) GetDockerFile

func (g *Github) GetDockerFile(p *Project) (content []byte, err error)

func (*Github) GetFiles added in v0.4.4

func (g *Github) GetFiles(p *Project) (files []*File, err error)

func (*Github) GetLastCommit

func (g *Github) GetLastCommit(p *Project) (Commit, error)

func (*Github) GetLastRevision

func (g *Github) GetLastRevision(p *Project) (Revision, error)

type Image

type Image struct {
	DockerEndPoint string
	docker.APIImages
}

func (Image) BelongsTo

func (i Image) BelongsTo(p *Project) bool

func (Image) GetRepoTagsAsImageID added in v0.4.4

func (i Image) GetRepoTagsAsImageID() []ImageID

type ImageID added in v0.4.4

type ImageID string

func (ImageID) BelongsTo added in v0.4.4

func (i ImageID) BelongsTo(p *Project) bool

func (ImageID) GetProjectString added in v0.4.4

func (i ImageID) GetProjectString() string

func (ImageID) GetRevisionString added in v0.4.4

func (i ImageID) GetRevisionString() string

func (ImageID) IsRevision added in v0.4.4

func (i ImageID) IsRevision(rev Revision) bool

type ImagesByCreated

type ImagesByCreated []*Image

func (ImagesByCreated) Len

func (c ImagesByCreated) Len() int

func (ImagesByCreated) Less

func (c ImagesByCreated) Less(i, j int) bool

func (ImagesByCreated) Swap

func (c ImagesByCreated) Swap(i, j int)
type Link struct {
	Project   *Project
	Container string
	Alias     string
}

func (*Link) String

func (l *Link) String() string

type LinkDefinition

type LinkDefinition string

func (LinkDefinition) GetAlias

func (l LinkDefinition) GetAlias() string

func (LinkDefinition) GetProjectName

func (l LinkDefinition) GetProjectName() string

type Project

type Project struct {
	Name                string
	Repository          VCS
	RelatedRepositories []VCS    `gcfg:"RelatedRepository"`
	Dockerfile          string   `default:"Dockerfile"`
	GithubToken         string   `json:"-"`
	History             int      `default:"3"`
	UseShortRevisions   bool     `default:"true"`
	Files               []string `gcfg:"File"`
	TestCommand         string
	NoCache             bool
	Restart             string
	Ports               []string         `gcfg:"Port"`
	Binds               []string         `gcfg:"Volume"`
	VolumesFrom         []string         `gcfg:"VolumeFrom"`
	Links               map[string]*Link `json:"-"`
	LinkNames           []LinkDefinition `gcfg:"Link"`
	LinkedBy            []*Project       `json:"-"`
	Environments        map[string]*Environment
	EnvironmentNames    []string `gcfg:"Environment"`
	TaskStatus          TaskStatus
	WebHook             string `gcfg:"WebHook"`
}

func (*Project) Deploy

func (p *Project) Deploy(environment string, output io.Writer, force bool) []error

func (*Project) ListContainers added in v0.1.0

func (p *Project) ListContainers() ([]*Container, []error)

func (*Project) ListImages added in v0.1.0

func (p *Project) ListImages() ([]*Image, []error)

func (*Project) Status

func (p *Project) Status() ([]*ProjectStatus, []error)

func (*Project) StatusByEnvironment added in v0.1.0

func (p *Project) StatusByEnvironment(e *Environment) (*ProjectStatus, []error)

func (*Project) String

func (p *Project) String() string

func (*Project) Test

func (p *Project) Test(environment string) (*ProjectDeployResult, error)

type ProjectDeployResult

type ProjectDeployResult struct {
	*command.ExecutionResponse
}

type ProjectStatus

type ProjectStatus struct {
	Environment       *Environment
	LastRevision      Revision
	RunningContainers []*Container
	Containers        []*Container
}

type Revision

type Revision map[VCS]Commit

func (Revision) Get

func (r Revision) Get() string

func (Revision) GetShort

func (r Revision) GetShort() string

func (Revision) String

func (r Revision) String() string

type Subscriber added in v0.1.0

type Subscriber struct {
	Handler func(...interface{})
}

type Task added in v0.2.0

type Task string
const (
	Deploy Task = "deploy"
)

type TaskStatus added in v0.2.0

type TaskStatus map[string]map[Task]time.Time

func (TaskStatus) Start added in v0.2.0

func (ts TaskStatus) Start(e *Environment, t Task)

func (TaskStatus) Stop added in v0.2.0

func (ts TaskStatus) Stop(e *Environment, t Task)

type VCS

type VCS string

func (VCS) Info

func (v VCS) Info() *VCSInfo

func (VCS) IsValid

func (v VCS) IsValid() bool

type VCSInfo

type VCSInfo struct {
	Origin string
	Branch string
	*vcsurl.RepoInfo
}

Jump to

Keyboard shortcuts

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