deployment

package
v0.8.11 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Replay

func Replay(events []ddd.Event) ddd.Aggregate

Replay recreates the deployment from a series of events

Types

type Created

type Created struct {
	Timestamp int64
	UUID      string
	Name      string
	Token     string
	RepoID    string
	Branch    string
	FilePath  string
}

Created is the event for when a new deployment is created

func (Created) EventType

func (e Created) EventType() string

EventType marks this as an event

type Deployment

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

Deployment represents the basic information about a deployment

func Create

func Create(uuid, name, token, repoID, branch, filePath string, timestamp int64) (*Deployment, error)

Create handles create commands

func (*Deployment) Branch

func (d *Deployment) Branch() string

Branch returns the branch of the repo for this deployment's yaml file

func (*Deployment) Destroy

func (d *Deployment) Destroy(timestamp int64) error

Destroy handles destroy commands

func (*Deployment) Destroyed

func (d *Deployment) Destroyed() bool

Destroyed determines if this deployment has been destroyed

func (*Deployment) Events

func (d *Deployment) Events() []ddd.Event

Events returns this deployment's event history

func (*Deployment) FilePath

func (d *Deployment) FilePath() string

FilePath returns the file path of the repo for this deployment's yaml file

func (*Deployment) Name

func (d *Deployment) Name() string

Name returns this deployment's name

func (*Deployment) RepoID

func (d *Deployment) RepoID() string

RepoID returns the uuid of the repo for this deployment's yaml file

func (*Deployment) Token added in v0.7.0

func (d *Deployment) Token() string

Token gets this deployment's token

func (*Deployment) UUID

func (d *Deployment) UUID() string

UUID returns this deployment's identifier

func (*Deployment) Update

func (d *Deployment) Update(name, repoID, branch, filePath string, timestamp int64) error

Update handles update commands

func (*Deployment) Version

func (d *Deployment) Version() int

Version returns this deployment's version number (NOTE: aggregate version!)

type Destroyed

type Destroyed struct {
	Timestamp int64
}

Destroyed is the event for when a deployment is destroyed

func (Destroyed) EventType

func (e Destroyed) EventType() string

EventType marks this as an event

type ReadRepository

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

ReadRepository is the repository for dealing with deployment reads

func NewReadRepository

func NewReadRepository(s storage.Storage) *ReadRepository

NewReadRepository creates a repository with the given storage

func (*ReadRepository) All

func (rr *ReadRepository) All() ([]*Deployment, error)

All gets all deployments

func (*ReadRepository) Load

func (rr *ReadRepository) Load(uuid string) (*Deployment, error)

Load gets one deployment

type Service

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

Service is the implementation for twirp to use

func NewService

func NewService(ag agent.AgentAction, au auth.Agent, g git.Agent, s storage.Storage) *Service

NewService creates the service

func (Service) All

All gets all deployments currently configured and their status

func (Service) Approvals added in v0.8.0

func (s Service) Approvals(ctx context.Context, req *pb.ReadApprovals) (*pb.ApprovalsRead, error)

Approvals gets all approvals for the user

func (Service) Approve added in v0.8.0

func (s Service) Approve(ctx context.Context, cmd *pb.ApproveStep) (*pb.StepApproved, error)

Approve a step for a run

func (Service) Create

Create adds a deployment to the list of configurations

func (Service) Destroy

Destroy removes a deployment from the list of configurations

func (Service) Manual added in v0.7.0

func (s Service) Manual(ctx context.Context, cmd *tr.TriggerManual) (*tr.ManualTriggered, error)

Manual triggers a deployment manually

func (Service) Read

Read reads out a deployment

func (Service) Ready

func (s Service) Ready() error

Ready implements the ReadyService method so this service can be part of a health check routine

func (Service) Run

func (s Service) Run(ctx context.Context, req *pb.ReadRun) (*pb.RunRead, error)

Run reads all the information about a particular run

func (Service) Runs

func (s Service) Runs(ctx context.Context, req *pb.ReadRuns) (*pb.RunsRead, error)

Runs reads a summary of all runs for a particular deployment

func (Service) Status added in v0.8.5

func (s Service) Status(ctx context.Context, cmd *tr.ReadStatus) (*tr.StatusRead, error)

Status gets the status of a run

func (Service) Template

Template takes a deployment and templates its yaml out for verification and viewing

func (Service) Token added in v0.7.0

Token gets the token for this deployment, for use with web calls

func (Service) Update

Update edits an already existing deployment

func (Service) Web added in v0.7.0

func (s Service) Web(ctx context.Context, cmd *tr.TriggerWeb) (*tr.WebTriggered, error)

Web triggers a deployment from a web call

type Updated

type Updated struct {
	Timestamp int64
	Name      string
	RepoID    string
	Branch    string
	FilePath  string
}

Updated is the event for when a deployment is updated

func (Updated) EventType

func (e Updated) EventType() string

EventType marks this as an event

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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