ciutil

package
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCI

func IsCI() bool

IsCI returns true if we are running in a known CI system.

Types

type System

type System string

System is a recognized CI system.

const (
	AppVeyor                    System = "AppVeyor"
	AWSCodeBuild                System = "AWS CodeBuild"
	AtlassianBamboo             System = "Atlassian Bamboo"
	AtlassianBitbucketPipelines System = "Atlassian Bitbucket Pipelines"
	Buildkite                   System = "Buildkite"
	CircleCI                    System = "CircleCI"
	Codeship                    System = "Codeship"
	Drone                       System = "Drone"
	GitHub                      System = "GitHub"
	GitLab                      System = "GitLab"
	GoCD                        System = "GoCD"
	Hudson                      System = "Hudson"
	Jenkins                     System = "Jenkins"
	MagnumCI                    System = "Magnum CI"
	MicrosoftTFS                System = "Microsoft Team Foundation Server"
	Semaphore                   System = "Semaphore"
	TaskCluster                 System = "TaskCluster"
	TeamCity                    System = "TeamCity"
	Travis                      System = "Travis CI"
)

func DetectSystem

func DetectSystem() System

DetectSystem returns a CI system name when the current system looks like a CI system. Detection is based on environment variables that CI vendors we know about set.

type Vars

type Vars struct {
	// Name is a required friendly name of the CI system.
	Name System
	// BuildID is an optional unique identifier for the current build/job.
	BuildID string
	// BuildType is an optional friendly type name of the build/job type.
	BuildType string
	// BuildURL is an optional URL for this build/job's webpage.
	BuildURL string
	// SHA is the SHA hash of the code repo at which this build/job is running.
	SHA string
	// BranchName is the name of the feature branch currently being built.
	BranchName string
	// CommitMessage is the full message of the Git commit being built.
	CommitMessage string
}

Vars contains a set of metadata variables about a CI system.

func DetectVars

func DetectVars() Vars

DetectVars detects and returns the CI variables for the current environment.

Jump to

Keyboard shortcuts

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