brigade

package module
v0.0.0-...-c97b049 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2017 License: MIT Imports: 14 Imported by: 0

README

brigade

brigade is a file transfer tool via ssh bucket brigade.

This software is alpha quality.

Install

go get -u github.com/fujiwara/brigade/cmd/brigade

Usage

brigade uses a transfer definition by text format. e.g.

# transfer.txt
www1 -> www2
www1 -> www3
www2 -> www4
www2 -> www5
--

brigade accepts concatenated the definition and a file content on STDIN.

[www1]$ cat transfer.txt /path/to/srcfile | brigade /path/to/dstfile
  1. on www1 brigade works
    • copy srcfile into dstfile.
    • execute
      • ssh www2 bridage /path/to/dstfile
      • ssh www3 bridage /path/to/dstfile
  2. on www2 brigade works
    • copy srcfile into dstfile.
    • execute
      • ssh www4 bridage /path/to/dstfile
      • ssh www5 bridage /path/to/dstfile
  3. on www3, www4, www5 brigade works
    • copy srcfile into dstfile.
Limitations (currently)
  • A brigade binary must be placed on the same path in all hosts.
  • for ssh
    • user is used from USER environment variable.
    • A identity file is fixed on $HOME/.ssh/id_rsa
  • hostnames in the transfer difinition must be equal to Golang's os.Hostname() (hostname(1) results).

LICENSE

The MIT License (MIT)

Copyright (c) 2017 FUJIWARA Shunichiro / KAYAC Inc.

Documentation

Index

Constants

View Source
const (
	NodeSeparator = "->"
	EOFMaker      = "--"
	LineDelimiter = "\n"
)

Variables

This section is empty.

Functions

func Run

func Run(filename string, mode os.FileMode)

func StoreFile

func StoreFile(name string, r io.Reader, mode os.FileMode) error

Types

type Deliveries

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

func Parse

func Parse(src io.Reader) (*Deliveries, io.Reader, error)

func (*Deliveries) RemoteCommand

func (ds *Deliveries) RemoteCommand(dst string, filename string, mode os.FileMode)

func (Deliveries) String

func (ds Deliveries) String() string

type Delivery

type Delivery []string

func ParseLine

func ParseLine(line string) (*Delivery, error)

func (Delivery) Dest

func (d Delivery) Dest() string

func (Delivery) Src

func (d Delivery) Src() string

func (Delivery) String

func (d Delivery) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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