Documentation
¶
Index ¶
- Constants
- func DeleteTable(db dynamodbiface.ClientAPI, table string) error
- func EnsureTableExists(db dynamodbiface.ClientAPI, table string) error
- func ListClusters(svc ecsiface.ClientAPI) ([]string, error)
- func Tdb(image string, cmds ...string) error
- type DevEnv
- func (d *DevEnv) Delete() error
- func (d *DevEnv) MarkDeleted()
- func (d *DevEnv) MarkNew()
- func (d *DevEnv) MarkProcessed()
- func (d *DevEnv) MergeVersions(vs VersionMap) error
- func (d *DevEnv) Reap(confPath string) error
- func (d *DevEnv) Save() error
- func (d *DevEnv) SetVersion(repo string, version string)
- func (d *DevEnv) SetVersions(vs VersionMap)
- func (d *DevEnv) Sow(confPath string) error
- func (d *DevEnv) VersionMap() VersionMap
- type ExistsError
- type GromitClient
- type GromitCluster
- type GromitTask
- type NotFoundError
- type VersionMap
Constants ¶
const ( // STATE is the name of the state attribute in the DB STATE = "state" // NAME is the name of the name attribute in the DB :) NAME = "name" // NEW is the state when an env is new NEW = "new" // PROCESSED is the state when an env has been processed by the runner PROCESSED = "processed" // DELETED is when at least one of the branches for this env have been deleted DELETED = "deleted" )
Variables ¶
This section is empty.
Functions ¶
func DeleteTable ¶ added in v0.2.0
func DeleteTable(db dynamodbiface.ClientAPI, table string) error
DeleteTable unconditionally deletes the table
func EnsureTableExists ¶ added in v0.2.0
func EnsureTableExists(db dynamodbiface.ClientAPI, table string) error
EnsureTableExists creates a PAY_PER_REQUEST DynamoDB table. If the table already exists, it is not re-created nor is an error raised. Will create the table if ResourceNotFound is received
func ListClusters ¶ added in v1.3.9
ListClusters will return a list running ECS clusters. Just the names.
Types ¶
type DevEnv ¶ added in v0.2.0
type DevEnv struct { Name string `json:"name"` // contains filtered or unexported fields }
DevEnv represents the known (or desired) state of an environment based on the state in DynamoDB. This type is concerned with management of the DynamoDB item representing the state of an environment named DevEnv.Name
func GetDevEnv ¶ added in v1.4.0
GetDevEnv will get the named env with the supplied name from the DB
func GetEnvsByState ¶ added in v1.4.0
func GetEnvsByState(svc dynamodbiface.ClientAPI, table string, state string, repos []string) ([]DevEnv, error)
GetEnvsByState will fetch all envs in the supplied state from the DB Only attribute names matching the list in repos will be fetched If any error occurs while retrieving an env, it fails immediately and returns the list of envs that have been retrieved so far
func NewDevEnv ¶ added in v1.4.0
func NewDevEnv(name string, db dynamodbiface.ClientAPI, table string) *DevEnv
NewDevEnv returns an unsaved environment but the env is ready to be saved
func (*DevEnv) Delete ¶ added in v1.4.0
Delete will delete the env if its internal state is devenv.DELETED
func (*DevEnv) MarkDeleted ¶ added in v1.4.0
func (d *DevEnv) MarkDeleted()
func (*DevEnv) MarkProcessed ¶ added in v1.4.0
func (d *DevEnv) MarkProcessed()
func (*DevEnv) MergeVersions ¶ added in v1.4.0
func (d *DevEnv) MergeVersions(vs VersionMap) error
func (*DevEnv) Reap ¶ added in v1.4.0
Reap will destroy an env that was created with Sow() and delete it from the DB
func (*DevEnv) SetVersion ¶ added in v1.4.0
func (*DevEnv) SetVersions ¶ added in v1.4.0
func (d *DevEnv) SetVersions(vs VersionMap)
func (*DevEnv) VersionMap ¶ added in v1.4.0
func (d *DevEnv) VersionMap() VersionMap
Promote all versions to top-level keys. This is done so that VersionMap can support any list of repos at run time
type ExistsError ¶ added in v0.2.0
type ExistsError baseError
ExistsError is used when the environment exists but was updated via a method that is not idempotent
func (ExistsError) Error ¶ added in v0.2.0
func (e ExistsError) Error() string
type GromitClient ¶ added in v1.3.13
func (*GromitClient) Delete ¶ added in v1.3.13
func (g *GromitClient) Delete(name string) error
Delete uses DELETE to delete the env
type GromitCluster ¶ added in v1.4.0
GromitCluster represents an ECS cluster running an environment that was spun up by DevEnv.Sow() It represents the runtime state (ECR, ECS, R53) of an environment and is intended to encapsulate the AWS implementation specific details All its methods are read-only except for SyncDNS which will update the public Route53 entries for a developer environment
func FastFetchClusters ¶ added in v1.4.0
func FastFetchClusters(cnames []string) []*GromitCluster
FastFetchClusters will fetch an array of clusters concurrently
func GetGromitCluster ¶ added in v1.4.0
func GetGromitCluster(name string) (*GromitCluster, error)
GetGromitCluster returns a fully populated gromit cluster
func (*GromitCluster) Populate ¶ added in v1.4.0
func (c *GromitCluster) Populate() error
Populate will look up all tasks in this cluster and fill in the tasks array with IPs
func (*GromitCluster) SyncDNS ¶ added in v1.4.0
func (c *GromitCluster) SyncDNS(action route53.ChangeAction, zoneid string, domain string) error
SyncDNS will update the public Route53 records for cluster in zoneid The FQDN is constructed by appending domain to the task name
type GromitTask ¶ added in v1.4.0
GromitTask is used inside GromitCluster
type NotFoundError ¶ added in v0.2.0
type NotFoundError baseError
NotFoundError is used to distinguish between other errors and this expected error in getEnv and elsewhere
func (NotFoundError) Error ¶ added in v0.2.0
func (e NotFoundError) Error() string
type VersionMap ¶ added in v1.4.0
VersionMap maps repos to any tree-ish in git
func GetECRState ¶ added in v0.2.0
func GetECRState(svc ecriface.ClientAPI, registry string, envName string, repos []string) (VersionMap, error)
GetECRState returns master as the tree-ish if no env was found