cmdutil

package
v0.9.20 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package cmdutil provides utility functions and types for working with the 'scribe' CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NotifySignals

func NotifySignals(c chan os.Signal)

func StepCommand

func StepCommand(opts CommandOpts) ([]string, error)

StepCommand returns the command string for running a single step. The path argument can be omitted, which is particularly helpful if the current directory is a pipeline.

func WatchSignals

func WatchSignals() os.Signal

WatchSignals blocks the current goroutine / thread and waits for any signal and returns an error

Types

type CommandOpts

type CommandOpts struct {
	// Step is the pipeline step this command is being generated for. The step contains a lot of necessary information for generating a command, mostly around arguments.
	Step pipeline.Step

	// CompiledPipeline is an optional argument. If it is supplied, this value will be used as the first argument in the command instead of the scribe command.
	// This option is useful scenarios where the 'scribe' command will not be available, but the pipeline has been compiled.
	CompiledPipeline string
	// Path is an optional argument that refers to the path of the pipeline. For example, if our plan is to have this function generate `scribe ./ci`, the 'Path' would be './ci'.
	Path string
	// BuildID is an optional argument that will be supplied to the 'scribe' command as '-build-id'.
	BuildID string

	LogLevel string

	// State is an optional argument that is supplied as '-state'. It is a path to the JSON state file which allows steps to share data.
	State string
	// StateArgs pre-populate the state for a specific step. These strings can include references to environment variables using $.
	// Environment variables are left as-is and are not substituted.
	StateArgs map[string]string

	// Version sets the `-version` argument, which is normally automatically set by the scribe CLI.
	// This value is typically used to fetch a known good docker image.
	Version string
}

CommandOpts is a list of arguments that can be provided to the StepCommand function.

Jump to

Keyboard shortcuts

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