internal

package
v1.9.8 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const FileName = "butler.json"

FileName is the name of the config file

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildConfig added in v1.9.5

type BuildConfig struct {
	OutputPath     string   `json:"output_path"`      // The path of the executable to generate
	LDFlags        []string `json:"ld_flags"`         // The ldflags to pass to the build command
	LDFlagsDarwin  []string `json:"ld_flags_darwin"`  // The ldflags to pass to the build command for Darwin
	LDFlagsLinux   []string `json:"ld_flags_linux"`   // The ldflags to pass to the build command for Linux
	LDFlagsWindows []string `json:"ld_flags_windows"` // The ldflags to pass to the build command for Windows
	ExtraArgs      []string `json:"extra_args"`       // The extra arguments to pass to the build command
	UseGotip       bool     `json:"use_gotip"`        // Use gotip to build instead of Go itself
	DependentCmds  []string `json:"dependent_cmds"`   // commands depends on build; ex: run & test need a fresh build
	PreBuild       string   `json:"pre_build"`        // not being used
	PostBuild      string   `json:"post_build"`       // not being used
}

BuildConfig contains the build specific configuration settings

type Builder added in v1.9.5

type Builder struct {
	common.CommandRunner
	common.FileSystem
	common.Timer
	common.Version

	OutputPath string
	GOOS       string
	GOARCH     string
	Verbose    bool
	LogLevel   string
	LogDir     string
}

Builder implements the "build" command

func (Builder) Execute added in v1.9.5

func (builder Builder) Execute(project common.Project, cfg Config) error

Execute executes the command

func (*Builder) FixOSnARCH added in v1.9.7

func (builder *Builder) FixOSnARCH()

type Cleaner added in v1.9.5

type Cleaner struct {
	common.FileSystem
	Verbose  bool
	LogLevel string
	LogDir   string
}

Cleaner implements the "clean" command

func (Cleaner) Execute added in v1.9.5

func (cleaner Cleaner) Execute(project common.Project, cfg Config) error

Execute executes the command

type Config added in v1.9.5

type Config struct {
	Project     ProjectConfig     `json:"project"`      // Project contains the general project variables
	Build       BuildConfig       `json:"build"`        // Build contains the build specific project variables
	Package     PackageConfig     `json:"package"`      // Build contains the package specific project variables
	Run         RunConfig         `json:"run"`          // Build contains the run specific project variables
	Test        TestConfig        `json:"test"`         // Build contains the test specific project variables
	Staticcheck StaticcheckConfig `json:"staticcheck"`  // Staticcheck contains the settings for staticcheck
	DockerImage DockerImageConfig `json:"docker-image"` // Staticcheck contains the settings for creating a docker image
}

Config defines the project configuration

func NewConfigFromDir added in v1.9.5

func NewConfigFromDir(path string, logLvl string) (Config, error)

NewConfigFromDir parses the config from a file called "butler.json" which should be present in the specified path

func NewConfigFromPath added in v1.9.5

func NewConfigFromPath(path string) (Config, error)

NewConfigFromPath reads the configuration file from the specified path and returns the configuration settings

type Debugger added in v1.9.5

type Debugger struct {
	common.CommandRunner
	common.FileSystem
	common.Golang

	Args     []string
	Verbose  bool
	LogLevel string
	LogDir   string
}

Debugger implements the "debug" command

func (Debugger) Execute added in v1.9.5

func (debugger Debugger) Execute(project common.Project, cfg Config) error

Execute executes the command

type DockerImageConfig added in v1.9.5

type DockerImageConfig struct {
	Name            string `json:"name"`                     // The name of the Docker image to create
	Repository      string `json:"repository"`               // The repository to push to
	Tag             string `json:"tag"`                      // What should be used as the tag, either "revision" or "version". Defaults to "version"
	PruneAfterBuild bool   `json:"prune_images_after_build"` // Perform the image prune after building
}

DockerImageConfig contains the settings for docker-image

type DockerImager added in v1.9.5

type DockerImager struct {
	common.CommandRunner
	common.FileSystem
	common.Version

	Verbose  bool
	LogLevel string
	LogDir   string
}

DockerImager implements the "docker-image" command

func (DockerImager) Execute added in v1.9.5

func (dockerImager DockerImager) Execute(project common.Project, cfg Config) error

Execute executes the command

type Installer added in v1.9.5

type Installer struct {
	common.FileSystem
	common.Golang

	Verbose  bool
	LogLevel string
	LogDir   string
}

Installer implements the "install" command

func (Installer) Execute added in v1.9.5

func (installer Installer) Execute(project common.Project, cfg Config) error

Execute executes the command

type PackageConfig added in v1.9.5

type PackageConfig struct {
	IncludeReadme bool `json:"include_readme"` // Include the readme when packaging or not
}

PackageConfig contains the build specific configuration settings

type Packager added in v1.9.5

type Packager struct {
	common.CommandRunner
	common.Compressor
	common.FileSystem
	common.Timer

	Concurrency int
	Verbose     bool
	LogLevel    string
	LogDir      string
}

Packager implements the "package" command

func (Packager) Execute added in v1.9.5

func (packager Packager) Execute(project common.Project, cfg Config) error

Execute executes the command

type ProjectConfig added in v1.9.5

type ProjectConfig struct {
	Name        string `json:"name"`         // The name of the project
	Version     string `json:"version"`      // The version of the project
	Description string `json:"description"`  // The description of the project
	Copyright   string `json:"copyright"`    // The copyright statement for the project
	MainPackage string `json:"main_package"` // The package path to the main entry point (the package containing main)
}

ProjectConfig contains the general project variables

type RunConfig added in v1.9.5

type RunConfig struct {
	Environ map[string]string `json:"environ"` // The environment variables to use when running
}

RunConfig contains the run specific configuration settings

type Runner added in v1.9.5

type Runner struct {
	common.CommandRunner
	common.FileSystem

	Args     []string
	Verbose  bool
	LogLevel string
	LogDir   string
}

Runner implements the "run" command

func (Runner) Execute added in v1.9.5

func (runner Runner) Execute(project common.Project, cfg Config) error

Execute executes the command

type StaticChecker added in v1.9.5

type StaticChecker struct {
	common.CommandRunner
	common.FileSystem
	common.Golang

	Verbose  bool
	LogLevel string
	LogDir   string
}

StaticChecker implements the "staticcheck" command

func (StaticChecker) Execute added in v1.9.5

func (staticChecker StaticChecker) Execute(project common.Project, cfg Config) error

Execute executes the command

type StaticcheckConfig added in v1.9.5

type StaticcheckConfig struct {
	Checks []string `json:"checks"` // The checks which should be executed
}

StaticcheckConfig contains the settings for staticcheck

type TestConfig added in v1.9.5

type TestConfig struct {
	ExtraArgs []string `json:"extra_args"` // The extra arguments to pass to the test command
}

TestConfig contains the test specific configuration settings

type Tester added in v1.9.5

type Tester struct {
	common.CommandRunner

	Verbose  bool
	LogLevel string
	LogDir   string
}

Tester implements the "test" command

func (Tester) Execute added in v1.9.5

func (tester Tester) Execute(project common.Project, cfg Config) error

Execute executes the command

type Uninstaller added in v1.9.5

type Uninstaller struct {
	common.FileSystem
	common.Golang

	Verbose  bool
	LogLevel string
	LogDir   string
}

Uninstaller implements the "uninstall" command

func (Uninstaller) Execute added in v1.9.5

func (uninstaller Uninstaller) Execute(project common.Project, cfg Config) error

Execute executes the command

type Version added in v1.9.5

type Version struct {
	Verbose  bool
	LogLevel string
	LogDir   string
	Log      *logrus.Logger
}

Version implements the "version" command

func (Version) Execute added in v1.9.5

func (version Version) Execute(project common.Project, cfg Config) error

Execute executes the command

func (Version) GetLastCommitDate added in v1.9.5

func (version Version) GetLastCommitDate() (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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