core

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2015 License: MIT Imports: 23 Imported by: 16

Documentation

Index

Constants

View Source
const DEFAULT_BRANCH = "master"

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

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 {
	// contains filtered or unexported fields
}

func NewDockerfile added in v0.1.0

func NewDockerfile(blob []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
}

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(machines []string) *Etcd

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 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) 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

func (i Image) GetRepoTagsAsImageId() []ImageId

type ImageId

type ImageId string

func (ImageId) BelongsTo

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

func (ImageId) GetProjectString

func (i ImageId) GetProjectString() string

func (ImageId) GetRevisionString

func (i ImageId) GetRevisionString() string

func (ImageId) IsRevision

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"`
	Volumes             []string         `gcfg:"Volume"`
	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