ecspresso

package module
v0.0.2 Latest Latest
Warning

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

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

README

ecspresso

ecspresso is a deployment tool for Amazon ECS.

(pronounced same as "espresso")

Usage

$ ecspresso -h
Usage of ecspresso:
  -cluster string
    	ECS cluster name(required)
  -config string
    	Config file
  -region string
    	aws region
  -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.
Configuration file

YAML format.

region: ap-northeast-1
cluster: default
service: myService
task_definition: myTask.json
timeout: 5m

Keys are equal to comand line options.

Example

$ ecspresso -region ap-northeast-1 -cluster default -service myService -task-definition myTask.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 myService/default Service is stable now. Completed!

LICENCE

MIT

Author

KAYAC Inc.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(conf *Config) error

Types

type App added in v0.0.2

type App struct {
	Service        string
	Cluster        string
	TaskDefinition *ecs.TaskDefinition
	Registered     *ecs.TaskDefinition
	// contains filtered or unexported fields
}

func (*App) DescribeServiceDeployments added in v0.0.2

func (d *App) DescribeServiceDeployments(ctx context.Context) error

func (*App) DescribeServicesInput added in v0.0.2

func (d *App) DescribeServicesInput() *ecs.DescribeServicesInput

func (*App) LoadTaskDefinition added in v0.0.2

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

func (*App) Log added in v0.0.2

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

func (*App) Name added in v0.0.2

func (d *App) Name() string

func (*App) RegisterTaskDefinition added in v0.0.2

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

func (*App) UpdateService added in v0.0.2

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

func (*App) WaitServiceStable added in v0.0.2

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

type Config added in v0.0.2

type Config struct {
	Region             string        `yaml:"region"`
	Service            string        `yaml:"service"`
	Cluster            string        `yaml:"cluster"`
	TaskDefinitionPath string        `yaml:"task_definition"`
	Timeout            time.Duration `yaml:"timeout"`
}

func (*Config) Validate added in v0.0.2

func (c *Config) Validate() error

Directories

Path Synopsis
cmd
ecspresso command

Jump to

Keyboard shortcuts

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