task

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecutionTask

type ExecutionTask struct {
	Target   Target
	Path     string
	Shutdown bool
	Env      map[string]string
}

ExecutionTask encodes a Target with additional execution-time information.

type Repo added in v1.4.0

type Repo struct {
	URL  string
	User string
	Pass string
}

Repo represents a Git repo with credentials

type Target

type Target struct {
	// An optional label for the target
	Name string `required:"true" json:"name"`

	// The repository URL to watch for changes, either http or ssh.
	RepoURL string `required:"true" json:"url"`

	// The git branch to use
	Branch string `json:"branch"`

	// The command to run on each new Git commit
	Up []string `required:"true" json:"up"`

	// Down specifies the command to run during either a graceful shutdown or when the target is removed
	Down []string `json:"down"`

	// Environment variables associated with the target - do not store credentials here!
	Env map[string]string `json:"env"`

	// Whether or not to run `Command` on first run, useful if the command is `docker-compose up`
	InitialRun bool `json:"initial_run"`

	// Auth method to use from the auth store
	Auth string `json:"auth"`
}

Target represents a repository and the task to perform when that repository is updated.

func DiffTargets

func DiffTargets(oldTargets, newTargets []Target) (additions, removals []Target)

DiffTargets returns just the additions (also changes) and removals between the specified old targets and new targets

func (*Target) Execute

func (t *Target) Execute(dir string, env map[string]string, shutdown bool, inheritEnv bool) (err error)

Execute runs the target's command in the specified directory with the specified environment variables

type Targets

type Targets []Target

Targets is just a list of target objects, to implement the Sort interface

Jump to

Keyboard shortcuts

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