dewy

package module
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2021 License: MIT Imports: 22 Imported by: 0

README

DEWY

DEWY: The application server for automated deployment with polling a repository.

GitHub Workflow Status GitHub Workflow Status GitHub Release MIT License Go Documentation codecov

Installation

To install, use go get:

$ go get -d github.com/linyows/dewy

Usage

When the application functions as a server:

$ cd /opt/yourapp
$ env GITHUB_TOKEN=xxx... SLACK_TOKEN=xxx... \
  dewy server --repository yourname/yourapp \
              --artifact yourapp_linux_amd64.tar.gz \
              --port 3000 \
              -- /opt/yourapp/current/yourapp

When the application and server are separated, or when the server is unnecessary:

$ cd /opt/yourapp
$ env GITHUB_TOKEN=xxx... SLACK_TOKEN=xxx... \
  dewy assets --repository yourname/yourapp \
              --artifact yourapp_linux_amd64.tar.gz

Architecture

Dewy has 3 abstract backends and can be used according to the user's environment.

  • Remote repository backend
  • Notification backend
  • Storage backend

Dewy shares the polling history within the cluster in storage so that it does not communicate excessively to remote repair acquisition.

dewy architecture

👉 Dewy is not CIOps but GitOps. As in the article on weave works, you do not have to grant permissions externally, so it's simple and easy to solve if problems arise.

Kubernetes anti-patterns: Let's do GitOps, not CIOps!
https://www.weave.works/blog/kubernetes-anti-patterns-let-s-do-gitops-not-ciops

Server mode

Process right after startup:

$ ps axf
/usr/bin/dewy server ...(main process)
 \_ /opt/your-app/current/your-app --args server (child process)

When deployment is started, a new child process is created and the old one is gracefully killed.

$ ps axf
/usr/bin/dewy server ...(main process)
 \_ /opt/your-app/current/your-app --args server (old child process) <-- kill
 \_ /opt/your-app/current/your-app --args server (current child process)

Provisioning

Todo

Repository

  • github release
  • git repo

KVS

  • file
  • memory
  • redis
  • consul
  • etcd

Notification

  • slack
  • email

Contribution

  1. Fork (https://github.com/linyows/dewy/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the main branch
  5. Run test suite with the go test ./... command and confirm that it passes
  6. Run gofmt -s
  7. Create a new Pull Request

Author

linyows

Documentation

Index

Constants

View Source
const (
	// ExitOK for exit code
	ExitOK int = 0

	// ExitErr for exit code
	ExitErr int = 1
)

Variables

This section is empty.

Functions

func RunCLI added in v0.6.0

func RunCLI(env Env) int

RunCLI runs as cli

Types

type CacheConfig

type CacheConfig struct {
	Type       CacheType
	Expiration int
}

CacheConfig struct

type CacheType

type CacheType int

CacheType for cache type

const (
	// NONE cache type
	NONE CacheType = iota
	// FILE cache type
	FILE
)

func (CacheType) String

func (c CacheType) String() string

String to string for CacheType

type Command added in v0.2.0

type Command int

Command for CLI

const (
	// SERVER command
	SERVER Command = iota
	// ASSETS command
	ASSETS
)

func (Command) String added in v0.2.0

func (c Command) String() string

String to string for Command

type Config

type Config struct {
	Command    Command
	Repository repo.Config
	Cache      CacheConfig
	Starter    starter.Config
}

Config struct

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns default Config

func (*Config) OverrideWithEnv

func (c *Config) OverrideWithEnv()

OverrideWithEnv overrides by environments

type Dewy

type Dewy struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Dewy struct

func New

func New(c Config) *Dewy

New returns Dewy

func (*Dewy) Run

func (d *Dewy) Run() error

Run dewy

func (*Dewy) Start added in v0.2.0

func (d *Dewy) Start(i int)

Start dewy

type Env added in v0.6.0

type Env struct {
	Out, Err io.Writer
	Args     []string
	Version  string
	Commit   string
	Date     string
}

Env struct

type StarterConfig added in v0.6.0

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

StarterConfig struct

func (StarterConfig) Args added in v0.6.0

func (c StarterConfig) Args() []string

Args for StarterConfig

func (StarterConfig) Command added in v0.6.0

func (c StarterConfig) Command() string

Command for StarterConfig

func (StarterConfig) Dir added in v0.6.0

func (c StarterConfig) Dir() string

Dir for StarterConfig

func (StarterConfig) Interval added in v0.6.0

func (c StarterConfig) Interval() time.Duration

Interval for StarterConfig

func (StarterConfig) Paths added in v0.6.0

func (c StarterConfig) Paths() []string

Paths for StarterConfig

func (StarterConfig) PidFile added in v0.6.0

func (c StarterConfig) PidFile() string

PidFile for StarterConfig

func (StarterConfig) Ports added in v0.6.0

func (c StarterConfig) Ports() []string

Ports for StarterConfig

func (StarterConfig) SignalOnHUP added in v0.6.0

func (c StarterConfig) SignalOnHUP() os.Signal

SignalOnHUP for StarterConfig

func (StarterConfig) SignalOnTERM added in v0.6.0

func (c StarterConfig) SignalOnTERM() os.Signal

SignalOnTERM for StarterConfig

func (StarterConfig) StatusFile added in v0.6.0

func (c StarterConfig) StatusFile() string

StatusFile for StarterConfig

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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