sailtrim

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: MIT Imports: 19 Imported by: 0

README

sailtrim

A minimal deployment tool for Amazon Lightsail Container.

Usage

usage: sailtrim [<flags>] <command> [<args> ...]

Flags:
  --help                  Show context-sensitive help (also try --help-long and --help-man).
  --log-level=info        log level (trace, debug, info, warn, error)
  --config="config.yaml"  configuration file path

Commands:
  help [<command>...]
    Show help.

  version
    show version

  deploy
    create new deployment

  update
    update container service

  status [<flags>]
    show container service status

  init --service-name=SERVICE-NAME
    initialize a container service

  logs [<flags>]
    show logs

Configuration

# config.yaml
service: service.json
deployment: deployment.json

service.json represents container service attributes.

{
  "containerServiceName": "container-service-1",
  "power": "micro",
  "scale": 1
}

deployment.json represents a deployments of container service.

{
  "containers": {
    "nginx": {
      "image": "nginx:latest",
      "command": [],
      "environment": {
        "FOO": "BAR"
      },
      "ports": {
        "80": "HTTP"
      }
    }
  },
  "publicEndpoint": {
    "containerName": "nginx",
    "containerPort": 80,
    "healthCheck": {
      "healthyThreshold": 2,
      "unhealthyThreshold": 2,
      "timeoutSeconds": 2,
      "intervalSeconds": 5,
      "path": "/",
      "successCodes": "200-499"
    }
  }
}

LICENSE

MIT License

Copyright (c) 2020 FUJIWARA Shunichiro

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalJSON

func MarshalJSON(s interface{}) ([]byte, error)

func MarshalJSONString

func MarshalJSONString(s interface{}) string

Types

type Config

type Config struct {
	Service    string `json:"service"`
	Deployment string `json:"deployment"`
}

Config represents configurations for SailTrim

type DeployOption

type DeployOption struct {
	DryRun *bool
}

DeployOption represents options for Deploy.

type LogsOption

type LogsOption struct {
	ContainerName *string
	StartTimeStr  *string
	EndTimeStr    *string
	FilterPattern *string
}

type SailTrim

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

SailTrim represents an application.

func New

func New(sess *session.Session, path string) (*SailTrim, error)

New creates a SailTrim instance.

func (*SailTrim) Deploy

func (s *SailTrim) Deploy(ctx context.Context) error

Deploy deploies a container service with new deployment.

func (*SailTrim) Init

func (s *SailTrim) Init(ctx context.Context, serviceName string) error

Init initializes a container service.

func (*SailTrim) Logs

func (s *SailTrim) Logs(ctx context.Context, opt LogsOption) error

func (*SailTrim) Status

func (s *SailTrim) Status(ctx context.Context, opt StatusOption) error

Status shows stauts of a container service.

func (*SailTrim) Update

func (s *SailTrim) Update(ctx context.Context) error

Update updates container service attributes.

type StatusOption

type StatusOption struct {
	Detail bool
}

StatusOption represents options for Status()

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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