ecspresso

package module
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2017 License: MIT Imports: 9 Imported by: 2

README

ecspresso

ecspresso is a deployment tool for Amazon ECS.

(pronounced same as "espresso")

Usage

$ ecspresso
  -cluster string
    	ECS cluster name(required)
  -service string
    	ECS service name(required)
  -task-definition string
    	task definition path(required)
  -timeout int
    	timeout (sec) (default 300)

ecspresso works as below.

  • Register a new task definition from JSON file.
    • JSON file is same format as aws ecs describe-task-definition output.
    • Replace {{ env "FOO" "bar" }} syntax in the JSON file to environment variable "FOO".
      • If "FOO" is not defined, replaced by "bar"
    • Replace {{ must_env "FOO" }} syntax in the JSON file to environment variable "FOO".
      • If "FOO" is not defined, abort immediately.
  • Update a service definition.
  • Wait a service stable.

Example

$ ecspresso -cluster default -service myService -task-definition app.json
2017/11/07 09:07:12 myService/default Starting ecspresso
2017/11/07 09:07:12 myService/default Creating a new task definition by app.json
2017/11/07 09:07:12 myService/default Registering a new task definition...
2017/11/07 09:07:15 myService/default Task definition is registered myService:2
2017/11/07 09:07:15 myService/default Updating service...
2017/11/07 09:07:16 myService/default Waiting for service stable...(it will takea few minutes)
2017/11/07 09:10:02 preview/bench-server Service is stable now. Completed!

Requirements

  • aws-cli

LICENCE

MIT

Author

KAYAC Inc.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(service, cluster, path string, timeout time.Duration) error

Types

type Deployment

type Deployment struct {
	Service        string
	Cluster        string
	TaskDefinition *TaskDefinition
	Registered     *TaskDefinition
}

func (*Deployment) LoadTaskDefinition

func (d *Deployment) LoadTaskDefinition(path string) error

func (*Deployment) Log

func (d *Deployment) Log(v ...interface{})

func (*Deployment) Name

func (d *Deployment) Name() string

func (*Deployment) RegisterTaskDefinition

func (d *Deployment) RegisterTaskDefinition(ctx context.Context) error

func (*Deployment) UpdateService

func (d *Deployment) UpdateService(ctx context.Context) error

func (*Deployment) WaitServiceStable

func (d *Deployment) WaitServiceStable(ctx context.Context) error

type TaskDefinition

type TaskDefinition struct {
	ContainerDefinitions []map[string]interface{} `yaml:"containerDefinitions" json:"containerDefinitions"`
	Family               string                   `yaml:"family" json:"family"`
	NetworkMode          string                   `yaml:"networkMode" json:"networkMode"`
	PlacementConstraints []map[string]string      `yaml:"placementConstraints" json:"placementConstraints"`
	RequiresAttributes   []map[string]string      `yaml:"requiresAttributes" json:"requiresAttributes"`
	Revision             int                      `yaml:"revision" json:"revision"`
	Status               string                   `yaml:"status" json:"status"`
	TaskRoleArn          string                   `yaml:"taskRoleArn" json:"taskRoleArn"`
	Volumes              []map[string]interface{} `yaml:"volumes" yaml:"json"`
}

func (*TaskDefinition) Name

func (t *TaskDefinition) Name() string

type TaskDefinitionContainer

type TaskDefinitionContainer struct {
	TaskDefinition TaskDefinition `yaml:"taskDefinition" json:"taskDefinition"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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