Documentation
¶
Index ¶
- Constants
- func GetPivotalIDFromCommits(owner, repoName, current, latest string) ([]int, error)
- func LockEnvironment(client ETCDInterface, projectName, projectEnv, lock string) (err error)
- func PostToPivotal(piv *PivotalConfiguration, env, owner, name, current, latest string) error
- func SetComment(client ETCDInterface, projectName, projectEnv, comment string) (err error)
- func Store(client ETCDInterface, cfg Config) error
- type Config
- type ETCDInterface
- type Environment
- type HostType
- type PivotalConfiguration
- type Project
- type Repo
- type RepositoryType
Constants ¶
const ( // RepoTypeGithub means sources codes of the targets of deployment are stored in github and we deploy from the codes. RepoTypeGithub = RepositoryType("github") // RepoTypeDocker means prebuilt docker images are the targets of deployment. RepoTypeDocker = RepositoryType("docker") // HostTypeNode means deploy target host is a normal server HostTypeNode = HostType("node") // HostTypeK8s means deploy target host is a k8s cluster HostTypeK8s = HostType("k8s") )
Variables ¶
This section is empty.
Functions ¶
func GetPivotalIDFromCommits ¶
func LockEnvironment ¶
func LockEnvironment(client ETCDInterface, projectName, projectEnv, lock string) (err error)
LockEnvironment Locks or unlock an environment for deploy
func PostToPivotal ¶
func PostToPivotal(piv *PivotalConfiguration, env, owner, name, current, latest string) error
func SetComment ¶
func SetComment(client ETCDInterface, projectName, projectEnv, comment string) (err error)
SetComment will set the comment field on an environment
Types ¶
type Config ¶
type Config struct { Projects []Project `json:"-" yaml:"projects,omitempty"` DeployUser string `json:"deploy_user" yaml:"deploy_user"` Notify string `json:"notify" yaml:"notify"` Pivotal *PivotalConfiguration `json:"pivotal,omitempty" yaml:"pivotal,omitempty"` }
Config is a set of Goship configurations
func Load ¶
func Load(client ETCDInterface) (Config, error)
Load loads a deployment configuration from etcd
type ETCDInterface ¶
type ETCDInterface interface { Get(string, bool, bool) (*etcd.Response, error) Set(string, string, uint64) (*etcd.Response, error) }
ETCDInterface emulates ETCD to allow testing
type Environment ¶
type Environment struct { Name string `json:"-" yaml:"name"` Deploy string `json:"deploy" yaml:"deploy"` RepoPath string `json:"repo_path" yaml:"repo_path"` Hosts []string `json:"hosts" yaml:"hosts,omitempty"` Branch string `json:"branch" yaml:"branch"` Comment string `json:"comment" yaml:"comment"` IsLocked bool `json:"is_locked,omitempty" yaml:"is_locked,omitempty"` K8sNamespace string `json:"k8s_namespace" yaml:"k8s_namespace"` }
Environment stores information about an individual environment, such as its name and whether it is deployable.
func EnvironmentFromName ¶
func EnvironmentFromName(projects []Project, projectName, environmentName string) (*Environment, error)
EnvironmentFromName takes an environment and project name as a string and returns an environment by the given environment name under a project with the given project name if it can find one.
type PivotalConfiguration ¶
type PivotalConfiguration struct { Token string `json:"token" yaml:"token"` AddLabel bool `json:"add_label" yaml:"add_label"` }
PivotalConfiguration used to store Pivotal interface
type Project ¶
type Project struct { Name string `json:"-" yaml:"name"` Repo `json:",inline" yaml:",inline"` RepoType RepositoryType `json:"repo_type" yaml:"repo_type"` HostType HostType `json:"host_type" yaml:"host_type"` Environments []Environment `json:"-" yaml:"envs"` TravisToken string `json:"travis_token" yaml:"travis_token"` K8sResource string `json:"k8s_resource" yaml:"k8s_resource"` K8sSelector string `json:"k8s_selector" yaml:"k8s_selector"` // Source is an additional revision control system. // It is effective only if RepoType does not serve source codes. Source *Repo `json:"source,omitempty" yaml:"source,omitempty"` }
Project stores information about a GitHub project, such as its GitHub URL and repo name, and a list of extra columns (PluginColumns)
func ProjectFromName ¶
ProjectFromName takes a project name as a string and returns a project by that name if it can find one.
func (Project) SourceRepo ¶
type Repo ¶
type Repo struct { RepoOwner string `json:"repo_owner" yaml:"repo_owner"` RepoName string `json:"repo_name" yaml:"repo_name"` }
Repo identifies a revision repository
type RepositoryType ¶
type RepositoryType string
A RepositoryType describes a type of revision control system which manages target revisions of deployment.
func (RepositoryType) Valid ¶
func (t RepositoryType) Valid() bool