deployment

package
v0.0.0-...-7a98856 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2016 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATUS_WORKING     = "WORKING"
	STATUS_WAITING     = "WAITING"
	STATUS_REPLICATING = "REPLICATING"
	STATUS_COMPLETE    = "COMPLETE"
	STATUS_FAILED      = "FAILED"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Deployment

type Deployment struct {
	Id            string            `json:"id"`
	PackageId     string            `json:"packageId"`
	StatusMessage string            `json:"statusMessage"`
	Status        string            `json:"status"`
	Variables     map[string]string `json:"replacements"`
	Watch         bool              `json:"watch"`
	Template      string            `json:"template"`
	EstComplete   int64             `json:"estComplete"`
}

func (*Deployment) Deploy

func (d *Deployment) Deploy(p *Package, notifier DeploymentNotifier)

func (*Deployment) DeployTemplate

func (d *Deployment) DeployTemplate(p *Package, notifier DeploymentNotifier, templateName string)

type DeploymentNotifier

type DeploymentNotifier interface {
	DeploymentComplete(d *Deployment)
	DeploymentFailed(d *Deployment)
	Watch(key string, callback func(string))
}

type Deployments

type Deployments map[string]*Deployment

type ExecutionFragment

type ExecutionFragment struct {
	Cmd         string `json:"cmd"`
	Status      string
	StatusCmd   string `json:"status"`
	CheckCmd    string `json:"check"`
	ValidateCmd string `json:"validate"`
	// contains filtered or unexported fields
}

func MakeExecutionFragment

func MakeExecutionFragment(def map[string]interface{}) (*ExecutionFragment, bool)

type ExecutionFragments

type ExecutionFragments []*ExecutionFragment

type GoTemplateList

type GoTemplateList map[string]*GoTemplate.Template

type Package

type Package struct {
	Id                 string             `json:"id"`
	Tag                string             `json:"tag"`
	Name               string             `json:"name"`
	Version            string             `json:"version"`
	Strict             bool               `json:"strict"`
	Templates          []*Template        `json:"templates"`
	TemplatesBefore    ExecutionFragments `json:"template_before"`
	TemplatesAfter     ExecutionFragments `json:"template_after"`
	ProcessedTemplates GoTemplateList
	// contains filtered or unexported fields
}

func (*Package) DeployPackage

func (p *Package) DeployPackage(r *Repository, replacements map[string]string, watch bool) *Deployment

Callback from REST handler

func (*Package) DeployPackageTemplate

func (p *Package) DeployPackageTemplate(r *Repository, templateName string, replacements map[string]string, watch bool) *Deployment

Deploy a single template file from a Package TODO Should this require an existing deployment id? Probably yes. Is the usecase for being able to ad-hoc deploy template files without deploying a whole package worthwhile and not too dangerous? We may be breaking assumptions that Package creators have about the state of a deployment

func (*Package) ReDeployPackage

func (p *Package) ReDeployPackage(r *Repository, d *Deployment) *Deployment

func (*Package) ReDeployPackageTemplate

func (p *Package) ReDeployPackageTemplate(r *Repository, d *Deployment) *Deployment

type PackageDef

type PackageDef struct {
	Id              string        `json:"id"`
	Tag             string        `json:"tag"`
	Name            string        `json:"name"`
	Version         string        `json:"version"`
	Strict          bool          `json:"strict"`
	Templates       []TemplateDef `json:"templates"`
	TemplatesBefore []interface{} `json:"template_before"`
	TemplatesAfter  []interface{} `json:"template_after"`
}

type PackageDefs

type PackageDefs []PackageDef

type Packages

type Packages []Package

type Repository

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

func (*Repository) AddDeployment

func (r *Repository) AddDeployment(d *Deployment)

func (Repository) DeploymentComplete

func (r Repository) DeploymentComplete(d *Deployment)

func (Repository) DeploymentFailed

func (r Repository) DeploymentFailed(d *Deployment)

func (*Repository) Deployments

func (r *Repository) Deployments() Deployments

func (*Repository) FindDeployment

func (r *Repository) FindDeployment(id string) (*Deployment, error)

func (*Repository) FindPackage

func (r *Repository) FindPackage(id string) (Package, error)

func (*Repository) Init

func (r *Repository) Init(configDir string, allowUntagged bool, tags []string, journalBackend log.Journal, funcMap GoTemplate.FuncMap, notifier DeploymentNotifier)

Give us some seed data The notifier is used for the storage backend, I'm not happy with this design, it'll need to be refactored

func (*Repository) JournalDeployment

func (r *Repository) JournalDeployment(d *Deployment)

func (*Repository) LoadJournaledDeployments

func (r *Repository) LoadJournaledDeployments()

func (*Repository) LoadPackages

func (r *Repository) LoadPackages(funcMap GoTemplate.FuncMap)

func (*Repository) Packages

func (r *Repository) Packages() Packages

func (Repository) Watch

func (r Repository) Watch(key string, callback func(string))

type Template

type Template struct {
	Src         string             `json:"src"`
	Dest        string             `json:"dest"`
	Description string             `json:"description"`
	Before      ExecutionFragments `json:"before"`
	After       ExecutionFragments `json:"after"`
	Contents    string             `json:"contents"`
	Watch       []string           `json:"watch"`
	Owner       string             `json:"owner"`
	Group       string             `json:"group"`
	Mode        string             `json:"mode"`
	// contains filtered or unexported fields
}

type TemplateDef

type TemplateDef struct {
	Src         string      `json:"src"`
	Dest        string      `json:"dest"`
	Description string      `json:"description"`
	Before      interface{} `json:"before"`
	After       interface{} `json:"after"`
	Contents    string      `json:"contents"`
	Watch       interface{} `json:"watch"`
	Owner       string      `json:"owner"`
	Group       string      `json:"group"`
	Mode        string      `json:"mode"`
}

Jump to

Keyboard shortcuts

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