cli

package module
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: MIT Imports: 30 Imported by: 0

README ΒΆ

bk - The Buildkite CLI

Latest release

A command line interface for Buildkite.

πŸ’¬ Feedback

We'd love to hear any feedback and questions you might have. Please file an issue on GitHub and let us know πŸ’–

⬇️ Installation

On macOS, you can install with Homebrew:

brew install buildkite/cli/bk

On all other platforms, download a binary from the latest GitHub releases.

πŸ“„ Usage

# Sets up your credentials (stored in `$HOME/.buildkite/config.json` or `$BUILDKITE_CLI_CONFIG_FILE`)
bk configure

# Opens the current pipeline in your browser
bk browse

# List the pipelines that you have access to
bk pipeline list

# Triggers a build for the current directory's commit and branch
bk build create

# Runs the current directory's pipeline steps locally (requires the buildkite-agent to be installed)
bk local run

# Sets up your current git project directory for Buildkite, creating a .buildkite/pipeline.yml file, a pipeline in Buildkite, and setting up the webhooks on GitHub or Bitbucket
bk init

πŸ”¨ Development

Developed using Golang 1.11+ with modules.

export GO111MODULE=on
git clone git@github.com:buildkite/cli.git
cd cli/
go run ./cmd/bk --help

Documentation ΒΆ

Index ΒΆ

Constants ΒΆ

This section is empty.

Variables ΒΆ

View Source
var (
	Debug bool
)
View Source
var (
	// Version is the version of the CLI tool
	Version = "2.0.0"
)

Functions ΒΆ

func ArtifactDownloadCommand ΒΆ

func ArtifactDownloadCommand(ctx ArtifactDownloadCommandContext) error

func BrowseCommand ΒΆ

func BrowseCommand(ctx BrowseCommandContext) error

func BuildCreateCommand ΒΆ

func BuildCreateCommand(ctx BuildCreateCommandContext) error

func ConfigureBuildkiteGraphQLCommand ΒΆ

func ConfigureBuildkiteGraphQLCommand(ctx ConfigureCommandContext) error

func ConfigureDefaultCommand ΒΆ

func ConfigureDefaultCommand(ctx ConfigureCommandContext) error

func ConfigureGithubCommand ΒΆ

func ConfigureGithubCommand(ctx ConfigureCommandContext) error

func InitCommand ΒΆ

func InitCommand(ctx InitCommandContext) error

func LocalRunCommand ΒΆ

func LocalRunCommand(ctx LocalRunCommandContext) error

func PipelineListCommand ΒΆ

func PipelineListCommand(ctx PipelineListCommandContext) error

func VersionString ΒΆ

func VersionString() string

Types ΒΆ

type ArtifactDownloadCommandContext ΒΆ

type ArtifactDownloadCommandContext struct {
	TerminalContext
	ConfigContext

	Debug     bool
	DebugHTTP bool

	Build   string
	Job     string
	Pattern string
}

type BrowseCommandContext ΒΆ

type BrowseCommandContext struct {
	TerminalContext
	ConfigContext

	Debug     bool
	DebugHTTP bool

	Dir    string
	Branch string
}

type BuildCreateCommandContext ΒΆ

type BuildCreateCommandContext struct {
	TerminalContext
	ConfigContext

	Debug     bool
	DebugHTTP bool

	Dir          string
	PipelineSlug string

	Branch   string
	Commit   string
	Message  string
	Env      []string
	Metadata map[string]string
}

type ConfigContext ΒΆ

type ConfigContext struct {
}

func (ConfigContext) BuildkiteGraphQLClient ΒΆ

func (cc ConfigContext) BuildkiteGraphQLClient() (*graphql.Client, error)

func (ConfigContext) GithubClient ΒΆ

func (cc ConfigContext) GithubClient() (*githubclient.Client, error)

type ConfigureCommandContext ΒΆ

type ConfigureCommandContext struct {
	TerminalContext
	ConfigContext

	Debug        bool
	DebugGraphQL bool
}

type ExitCoder ΒΆ

type ExitCoder interface {
	ExitCode() int
}

type ExitError ΒΆ

type ExitError struct {
	// contains filtered or unexported fields
}

func NewExitError ΒΆ

func NewExitError(err error, exitCode int) ExitError

func NewExitErrorString ΒΆ

func NewExitErrorString(msg string, exitCode int) ExitError

func (ExitError) Error ΒΆ

func (ex ExitError) Error() string

func (ExitError) ExitCode ΒΆ

func (ex ExitError) ExitCode() int

type InitCommandContext ΒΆ

type InitCommandContext struct {
	TerminalContext
	ConfigContext

	Debug     bool
	DebugHTTP bool

	Dir          string
	PipelineSlug string
}

type LocalRunCommandContext ΒΆ

type LocalRunCommandContext struct {
	TerminalContext
	ConfigContext

	Debug     bool
	DebugHTTP bool

	File            *os.File
	Env             []string
	Metadata        map[string]string
	Command         string
	StepFilterRegex *regexp.Regexp
	Prompt          bool
	DryRun          bool
	ListenPort      int
}

type PipelineListCommandContext ΒΆ

type PipelineListCommandContext struct {
	TerminalContext
	ConfigContext

	Debug     bool
	DebugHTTP bool

	Fuzzy   string
	Limit   int
	ShowURL bool
}

type Spinner ΒΆ

type Spinner interface {
	Start()
	Stop()
}

type Terminal ΒΆ

type Terminal struct {
}

func (*Terminal) Failure ΒΆ

func (t *Terminal) Failure(msg string)

func (*Terminal) Header ΒΆ

func (t *Terminal) Header(h string)

func (*Terminal) Printf ΒΆ

func (t *Terminal) Printf(s string, v ...interface{})

func (*Terminal) Println ΒΆ

func (t *Terminal) Println(s ...interface{})

func (*Terminal) ReadPassword ΒΆ

func (t *Terminal) ReadPassword(prompt string) (string, error)

func (*Terminal) ReadString ΒΆ

func (t *Terminal) ReadString(prompt string) (string, error)

func (*Terminal) Spinner ΒΆ

func (t *Terminal) Spinner() Spinner

func (*Terminal) Try ΒΆ

func (t *Terminal) Try() Tryer

func (*Terminal) WaitForKeyPress ΒΆ

func (t *Terminal) WaitForKeyPress(prompt string)

type TerminalContext ΒΆ

type TerminalContext interface {
	Header(h string)
	Println(s ...interface{})
	Printf(s string, v ...interface{})
	Failure(s string)
	WaitForKeyPress(prompt string)
	Spinner() Spinner
	Try() Tryer
	ReadPassword(prompt string) (string, error)
}

type Tryer ΒΆ

type Tryer interface {
	Start(msg string)
	Println(msg string)
	Success(msg string)
	Failure(msg string)
}

Directories ΒΆ

Path Synopsis
cmd
bk

Jump to

Keyboard shortcuts

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