plumbing

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package plumbing contains the internal scribe command utilities. Types and functions in this package should be written to be imported outside of the scribe project, and even in some scribe pipelines.

Index

Constants

View Source
const DefaultRepo = "grafana/shipwright"

Variables

View Source
var (
	ErrorMissingArgument = errors.New("argument requested but not provided")
)
View Source
var ErrorSkipValidation = errors.New("skipping step validation")

ErrorSkipValidation can be returned in the Client's Validate interface to prevent the error from stopping the pipeline execution

Functions

func DefaultImage

func DefaultImage(version string) string

func DefaultRegistry

func DefaultRegistry() string

func SubImage

func SubImage(image, version string) string

Types

type ArgMap

type ArgMap map[string]string

func (*ArgMap) Get

func (a *ArgMap) Get(key string) (string, error)

func (*ArgMap) Set

func (a *ArgMap) Set(val string) error

func (*ArgMap) String

func (a *ArgMap) String() string

type ErrorStack

type ErrorStack struct {
	Errors []error
}

func (*ErrorStack) Peek

func (e *ErrorStack) Peek() error

Peek returns the error at the end of the stack without removing it.

func (*ErrorStack) Pop

func (e *ErrorStack) Pop() error

Pop returns the error at the end of the stack and removes it.

func (*ErrorStack) Push

func (e *ErrorStack) Push(err error)

type OptionalInt

type OptionalInt struct {
	Value int64
	Valid bool
}

func (*OptionalInt) Set

func (o *OptionalInt) Set(v string) error

func (*OptionalInt) String

func (o *OptionalInt) String() string

type PipelineArgs

type PipelineArgs struct {
	Client string

	// Path is provided in every execution to the scribe run command,
	// and contians the user-supplied location of the scribe pipeline (or "." / "$PWD") by default.
	Path    string
	Version string

	// Step defines a specific step to run. Typically this is used in a generated third-party config
	// If Step is nil, then all steps are ran
	Step *int64

	// BuildID is a unique identifier typically assigned by a CI system.
	// In Docker / CLI mode, this will likely be populated by a random UUID if not provided.
	BuildID string

	// CanStdinPrompt is true if the pipeline can prompt for absent arguments via stdin
	CanStdinPrompt bool

	// ArgMap is a map populated by arguments provided using the `-arg` flag.
	// Example usage: `-arg={key}={value}
	ArgMap ArgMap

	// LogLvel defines how detailed the output logs in the pipeline should be.
	// Possible options are [debug, info, warn, error].
	// The default value is warn.
	LogLevel logrus.Level

	// State is a URL where the build state is stored.
	// Examples:
	// * 'fs:///var/scribe/state.json' - Uses a JSON file to store the state.
	// * 'fs:///c:/scribe/state.json' - Uses a JSON file to store the state, but on Windows.
	// * 'fs:///var/scribe/state/' - Stores the state file in the given directory, using a randomly generated ID to store the state.
	//    * This might be a good option if implementing a Scribe client in a provider.
	// * 's3://bucket-name/path'
	// * 'gcs://bucket-name/path'
	// If 'State' is not provided, then one is created using os.Tmpdir.
	State string
}

PipelineArgs are provided to the `scribe` command.

func ParseArguments

func ParseArguments(args []string) (*PipelineArgs, error)

type PipelineError

type PipelineError struct {
	Err         string
	Description string
}

func NewPipelineError

func NewPipelineError(err string, desc string) *PipelineError

func (*PipelineError) Error

func (p *PipelineError) Error() string

Directories

Path Synopsis
cmd
Package main contains the logic for the `scribe` CLI Package main contains the CLI logic for the `scribe` command The scribe command's main responsibility is to run a pipeline.
Package main contains the logic for the `scribe` CLI Package main contains the CLI logic for the `scribe` command The scribe command's main responsibility is to run a pipeline.
Package cmdutil provides utility functions and types for working with the 'scribe' CLI.
Package cmdutil provides utility functions and types for working with the 'scribe' CLI.
Package pipeline contains the meta types and interfaces that define a Scribe pipeline.
Package pipeline contains the meta types and interfaces that define a Scribe pipeline.
clients/drone
Package drone contians the drone client implementation for generating a Drone pipeline config.
Package drone contians the drone client implementation for generating a Drone pipeline config.
dag
Package pipelineutil defines utilities for working with Pipelines and is separated as it may also import packages that import pipeline.
Package pipelineutil defines utilities for working with Pipelines and is separated as it may also import packages that import pipeline.
Package plog (or plumbig log) provides a logging initializer and utility functions for working with a logging library.
Package plog (or plumbig log) provides a logging initializer and utility functions for working with a logging library.
Package stringutil contains general string utilities used throughout this project.
Package stringutil contains general string utilities used throughout this project.
Package syncutil provides utilities for working with asynchronous tasks and provides wrappers around the "sync" package.
Package syncutil provides utilities for working with asynchronous tasks and provides wrappers around the "sync" package.

Jump to

Keyboard shortcuts

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