Documentation ¶
Overview ¶
Package build - build tools nolint
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // These flags override values in build env. GitCommitFlag = flag.String("git-commit", "", `Overrides git commit hash embedded into executables`) GitBranchFlag = flag.String("git-branch", "", `Overrides git branch being built`) GitTagFlag = flag.String("git-tag", "", `Overrides git tag being built`) BuildnumFlag = flag.String("buildnum", "", `Overrides CI build number`) PullRequestFlag = flag.Bool("pull-request", false, `Overrides pull request status of the build`) CronJobFlag = flag.Bool("cron-job", false, `Overrides cron job status of the build`) )
build flags
View Source
var DryRunFlag = flag.Bool("n", false, "dry run, don't execute commands")
DryRunFlag dry run flag
Functions ¶
func GoTool ¶
GoTool returns the command that runs a go tool. This uses go from GOROOT instead of PATH so that go commands executed by build use the same version of Go as the 'host' that runs build code. e.g.
/usr/lib/go-1.12.1/bin/go run build/ci.go ...
runs using go 1.12.1 and invokes go 1.12.1 tools from the same GOROOT. This is also important because runtime.Version checks on the host should match the tools that are run.
Types ¶
type Environment ¶
type Environment struct { Name string // name of the environment Repo string // name of GitHub repo Commit, Date, Branch, Tag string // Git info Buildnum string IsPullRequest bool IsCronJob bool }
Environment contains metadata provided by the build environment.
func Env ¶
func Env() *Environment
Env returns metadata about the current CI environment, falling back to LocalEnv if not running on CI.
func LocalEnv ¶
func LocalEnv() *Environment
LocalEnv returns build environment metadata gathered from git.
func (*Environment) String ¶
func (env *Environment) String() string
Click to show internal directories.
Click to hide internal directories.