specbuild

package
v0.0.0-...-3b91d86 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoJS = errors.New("specbuild: no JS code found")

ErrNoJS is returned by Generate when no JS code was found, meaning that the legacy code should be run instead.

Functions

func PerformActions

func PerformActions(ctx context.Context, cli client.CommonAPIClient, containerID string, actions []Action) error

PerformActions performs the given actions on the specified container.

func TagImage

func TagImage(ctx context.Context, cli client.ImageAPIClient, name, tag string, pull bool) error

TagImage tags an image (by name) with a given tag name. If pull is true, and the named image doesn't exist, then a pull is attempted.

Types

type Action

type Action struct {
	Action     string
	User       string
	WorkingDir string

	// Exec action
	Cmd   []string
	Env   []string
	Stdin *string

	// Write/append option
	Contents       string
	ContentsBase64 bool
	Filename       string

	// Gobuild action
	SrcPath  string
	Packages []string
	LDFlags  string

	// Parallel action
	Subactions []Action
}

Action defines an action that can be performed on a running container.

type GenerateOutput

type GenerateOutput struct {
	ImageName  string
	Dockerfile string
	Init       *bool

	PostBuild []Action

	User       string
	Cmd        []string
	Env        []string
	WorkingDir string
}

GenerateOutput is the output object given by the assignment's generate function.

func Generate

func Generate(ctx context.Context, assignmentPath string, specData interface{}) (*GenerateOutput, error)

Generate attempts to run the generate function of the assignment's module and returns its output.

Jump to

Keyboard shortcuts

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