travis

package
v3.4.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2016 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package travis implements some helper functions to use during tests. Many times certain facilities are not available, or tests must run differently.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Env

func Env(v EnvVar) string

Env returns the value of a travis env variable.

func IsRunning

func IsRunning() bool

IsRunning attempts to determine whether this process is running on Travis-CI. This is done by checking ALL of the following env vars are set:

CI=true
TRAVIS=true

Note: cannot just check CI.

func JobId

func JobId() string

JobId returns the travis JOB_ID of this build.

func JobNumber

func JobNumber() string

JobNumber returns the travis JOB_NUMBER of this build.

Types

type EnvVar

type EnvVar string

EnvVar is a type to use travis-only env var names with the type system.

const (
	VarCI            EnvVar = "CI"
	VarTravis        EnvVar = "TRAVIS"
	VarBranch        EnvVar = "TRAVIS_BRANCH"
	VarBuildDir      EnvVar = "TRAVIS_BUILD_DIR"
	VarBuildId       EnvVar = "TRAVIS_BUILD_ID"
	VarBuildNumber   EnvVar = "TRAVIS_BUILD_NUMBER"
	VarCommit        EnvVar = "TRAVIS_COMMIT"
	VarCommitRange   EnvVar = "TRAVIS_COMMIT_RANGE"
	VarJobId         EnvVar = "TRAVIS_JOB_ID"
	VarJobNumber     EnvVar = "TRAVIS_JOB_NUMBER"
	VarPullRequest   EnvVar = "TRAVIS_PULL_REQUEST"
	VarSecureEnvVars EnvVar = "TRAVIS_SECURE_ENV_VARS"
	VarRepoSlug      EnvVar = "TRAVIS_REPO_SLUG"
	VarOsName        EnvVar = "TRAVIS_OS_NAME"
	VarTag           EnvVar = "TRAVIS_TAG"
	VarGoVersion     EnvVar = "TRAVIS_GO_VERSION"
)

Environment variables that TravisCI uses.

Jump to

Keyboard shortcuts

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