Documentation ¶
Index ¶
- Constants
- func Bool(v BuildVar) bool
- func EnsureEnvVars(vars ...BuildVar) error
- func GenerateEnvFile() error
- func IfRelease(do func() error) error
- func IsFullBuild() (bool, error)
- func IsPR() (bool, error)
- func IsRelease() (bool, error)
- func Str(v BuildVar) string
- func WriteEnvVars(vars []EnvVar, filename string) error
- type BuildVar
- type EnvVar
Constants ¶
View Source
const ( // TagBuild indicates release build TagBuild = BuildVar("RELEASE_BUILD") // RCBuild indicates a release candidate build (containing "-rc") RCBuild = BuildVar("RC_BUILD") // SnapshotBuild indicates snapshot release build (master branch) SnapshotBuild = BuildVar("SNAPSHOT_BUILD") // PRBuild indicates pull-request build PRBuild = BuildVar("PR_BUILD") // BuildVersion stores build version BuildVersion = BuildVar("BUILD_VERSION") // PPAVersion stores build version for PPA PPAVersion = BuildVar("PPA_VERSION") // BuildNumber stores CI build number BuildNumber = BuildVar("BUILD_NUMBER") // BuildTag stores git tag for build BuildTag = BuildVar("BUILD_TAG") // BuildBranch stores branch name BuildBranch = BuildVar("BUILD_BRANCH") // BuildCommit stores git commit short SHA BuildCommit = BuildVar("BUILD_COMMIT") // BuildBranchSafe stores branch name, with special characters replaced with hyphens BuildBranchSafe = BuildVar("BUILD_BRANCH_SAFE") // GithubOwner stores github repository's owner GithubOwner = BuildVar("GITHUB_OWNER") // GithubRepository stores github repository name GithubRepository = BuildVar("GITHUB_REPO") // GithubSnapshotRepository stores github repository name for snapshot builds GithubSnapshotRepository = BuildVar("GITHUB_SNAPSHOT_REPO") // GithubAPIToken is used for accessing github API GithubAPIToken = BuildVar("GITHUB_API_TOKEN") // DockerHubUsername is hub.docker.com username under which to push snapshot builds DockerHubUsername = BuildVar("DOCKERHUB_USERNAME") // DockerHubPassword is hub.docker.com password of DockerHubUsername DockerHubPassword = BuildVar("DOCKERHUB_PASSWORD") // CommitMessage is HEAD commit message CommitMessage = BuildVar("CI_COMMIT_MESSAGE") )
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
Bool reads a bool env var. EnsureEnvVars should be called first to ensure it has a specified value.
func EnsureEnvVars ¶
EnsureEnvVars ensures that specified environment variables have a value. Purpose is to reduce boilerplate in mage target when reading multiple env vars.
func IsFullBuild ¶
IsFullBuild true when full build is requested via commit message `[ci full]`
func Str ¶
Str reads a string env var. EnsureEnvVars should be called first to ensure it has a specified value.
func WriteEnvVars ¶
WriteEnvVars writes vars to a shell script so they can be sourced `source env.sh` in latter build stages
Types ¶
Click to show internal directories.
Click to hide internal directories.