deployment

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2017 License: Apache-2.0 Imports: 12 Imported by: 6

Documentation

Index

Constants

View Source
const (
	TaskPending = "PENDING"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DeploymentService added in v0.3.0

type DeploymentService interface {
	// CreateDeployment creates a new deployment in the provided environment and updates the
	// environment's pending deployment ID to the ID of the deployment created. The environment
	// token must match the provided token, otherwise the deployment creation will fail.
	CreateDeployment(ctx context.Context, environmentName string, token string) (*deploymenttypes.Deployment, error)

	// CreateSubDeployment kicks off a deployment corresponding to the in progress deployment ID
	// in the environment to start tasks on given instances
	CreateSubDeployment(ctx context.Context, environmentName string, instanceARNs []*string) (*deploymenttypes.Deployment, error)

	// StartDeployment kicks off the provided deployment in the given environment (by starting tasks)
	StartDeployment(ctx context.Context, environmentName string, instanceARNs []*string) (*deploymenttypes.Deployment, error)

	// UpdateInProgressDeployment replaces an existing deployment in the environment with the
	// provided one if a deployment with the provided ID already exists
	UpdateInProgressDeployment(ctx context.Context, environmentName string, deployment *deploymenttypes.Deployment) error

	// GetDeployment returns the deployment with the provided id in the provided environment
	GetDeployment(ctx context.Context, environmentName string, id string) (*deploymenttypes.Deployment, error)

	// GetCurrentDeployment returns the deployment which needs to be used for starting tasks, i.e.
	// the in-progress deployment for the environment if one exists, otherwise the latest completed deployment.
	GetCurrentDeployment(ctx context.Context, environmentName string) (*deploymenttypes.Deployment, error)

	// GetPendingDeployment returns the pending deployment for the environment deployment.
	// There should be no more than one pending deployments in an environment.
	GetPendingDeployment(ctx context.Context, environmentName string) (*deploymenttypes.Deployment, error)

	// GetInProgressDeployment returns the in-progress deployment for the environmentName.
	// There should be no more than one in progress deployments in an environment.
	GetInProgressDeployment(ctx context.Context, environmentName string) (*deploymenttypes.Deployment, error)

	// ListDeploymentsSortedReverseChronologically returns a list of deployments reverse-ordered by start time,
	// i.e. lastest deployment first
	ListDeploymentsSortedReverseChronologically(ctx context.Context, environmentName string) ([]deploymenttypes.Deployment, error)

	// ValidateAndCreateDeployment is a generator function for use by CreateDeployment().
	// It validates the environment corresponding to the deployment to be created and adds a
	// pending deployment to the environment if the validations succeed
	ValidateAndCreateDeployment(token string) (storetypes.ValidateAndUpdateEnvironment, *deploymenttypes.Deployment)

	// ValidateAndCreateSubDeployment is a generator function for use by CreateSubDeployment().
	// It validates the environment corresponding to the sub-deployment to be created. If the validations
	// succeed, tasks are started for the current deployment of the environment and the deployment information
	// is updated in the environment.
	ValidateAndCreateSubDeployment(instanceARNs []*string) (storetypes.ValidateAndUpdateEnvironment, *deploymenttypes.Deployment)

	// ValidateAndStartDeployment is a generator function for use by StartDeployment().
	// It validates the environment corresponding to the deployment to be started. If the validations
	// succeed, tasks are started for the pending deployment of the environment and the deployment information
	// is updated in the environment.
	ValidateAndStartDeployment(instanceARNs []*string) (storetypes.ValidateAndUpdateEnvironment, *deploymenttypes.Deployment)

	// ValidateAndUpdateInProgressDeployment is a generator function for use by UpdateInProgressDeployment().
	// It validates the environment corresponding to the deployment to be updated. If the validations
	// succeed, the deployment is updated using the deployment being passed in in the environment.
	ValidateAndUpdateInProgressDeployment(deployment *deploymenttypes.Deployment) storetypes.ValidateAndUpdateEnvironment
}

Deployment defines methods to handle deployments in an environment TODO: refactor to remove multiple environment retrievals from the database in some of the Get methods (check unit tests for GetEnvironment.Times(2 or 3))

func NewDeploymentService added in v0.3.0

func NewDeploymentService(
	environmentStore store.EnvironmentStore,
	clusterState facade.ClusterState,
	ecs facade.ECS) DeploymentService

type DeploymentWorker

type DeploymentWorker interface {
	StartPendingDeployment(ctx context.Context, environmentName string) (*deploymenttypes.Deployment, error)
	// UpdateInProgressDeployment checks for in-progress deployments and moves them to complete when
	// the tasks started by the deployment have moved out of pending status
	UpdateInProgressDeployment(ctx context.Context, environmentName string) (*deploymenttypes.Deployment, error)
}

func NewDeploymentWorker

func NewDeploymentWorker(
	environmentService environment.EnvironmentService,
	environmentFacade environment.EnvironmentFacade,
	deploymentService DeploymentService,
	ecs facade.ECS,
	css facade.ClusterState) DeploymentWorker

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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