piper

package module
v0.0.0-...-6a608ba Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2019 License: MIT Imports: 8 Imported by: 0

README

Build Status

piper

Like fly execute but running against a local docker daemon

But why?

Have you ever run fly execute with a set of huge inputs that take FOREVER to upload only to find out you had a typo in your task script? This is why.

But how?

piper is really just a wrapper around some calls to the docker cli. It pulls the image needed to run the task. It then runs docker run with some volume mounts for your inputs and outputs. Its as simple as that.

Installation

go get github.com/ryanmoran/piper/piper

Documentation

Index

Constants

View Source
const VolumeMountPoint = "/tmp/build"

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerClient

type DockerClient struct {
	Command *exec.Cmd
	Stdout  io.Writer
	Stderr  io.Writer
}

func (DockerClient) Pull

func (c DockerClient) Pull(image string, dryRun bool) error

func (DockerClient) Run

func (c DockerClient) Run(
	command []string,
	image string,
	envVars []DockerEnv,
	mounts []DockerVolumeMount,
	privileged bool,
	dryRun bool,
	rm bool,
) error

type DockerEnv

type DockerEnv struct {
	Key   string
	Value string
}

func (DockerEnv) String

func (e DockerEnv) String() string

type DockerVolumeMount

type DockerVolumeMount struct {
	LocalPath  string
	RemotePath string
}

func (DockerVolumeMount) String

func (m DockerVolumeMount) String() string

type EnvVarBuilder

type EnvVarBuilder struct{}

func (EnvVarBuilder) Build

func (b EnvVarBuilder) Build(environment []string, params map[string]string) []DockerEnv

type ImageResource

type ImageResource struct {
	Source ImageResourceSource
}

type ImageResourceSource

type ImageResourceSource struct {
	Repository string
	Tag        string
}

func (ImageResourceSource) String

func (i ImageResourceSource) String() string

type Parser

type Parser struct{}

func (Parser) Parse

func (p Parser) Parse(path string) (Task, error)

type Run

type Run struct {
	Path string   `yaml:"path"`
	Args []string `yaml:"args"`
	// contains filtered or unexported fields
}

type Task

type Task struct {
	Image         string `yaml:"image"`
	Run           Run
	Inputs        []VolumeMount
	Outputs       []VolumeMount
	Caches        []VolumeMount
	Params        map[string]string
	ImageResource ImageResource `yaml:"image_resource"`
}

type VolumeMount

type VolumeMount struct {
	Name     string `yaml:"name"`
	Path     string `yaml:"path"`
	Optional bool   `yaml:"optional"`
}

type VolumeMountBuilder

type VolumeMountBuilder struct{}

func (VolumeMountBuilder) Build

func (b VolumeMountBuilder) Build(resources []VolumeMount, inputs, outputs []string) ([]DockerVolumeMount, error)

Directories

Path Synopsis
fakes
docker command

Jump to

Keyboard shortcuts

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