Documentation ¶
Index ¶
Constants ¶
const ( PhaseMachine = Phase("machine") PhaseDependencies = Phase("dependencies") PhaseTest = Phase("test") PhaseDeployment = Phase("deployment") )
const CircleApiPrefix = "https://circleci.com/api/v1"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Build ¶
type Build struct { User string `json:"user"` Project string `json:"project"` ApiToken string `json:"token"` ProjectUser string `json:"project_user"` BuildNum int `json:"build_num"` PreviousBuildNum int `json:"previous_build_num"` GitRepo string `json:"git_repo"` GitBranch string `json:"git_branch"` Commit string `json:"commit"` ArtifactsDir string `json:"artifacts_dir"` LogStart func(Phase) LogEnd func(Phase, error) bool // contains filtered or unexported fields }
https://circleci.com/docs/environment-variables
CIRCLE_PROJECT_USERNAME The username or organization name of the project being tested, i.e. "foo" in circleci.com/gh/foo/bar/123 CIRCLE_PROJECT_REPONAME The repository name of the project being tested, i.e. "bar" in circleci.com/gh/foo/bar/123 CIRCLE_BRANCH The name of the branch being tested, e.g. 'master'. CIRCLE_SHA1 The SHA1 of the commit being tested. CIRCLE_COMPARE_URL A link to GitHub's comparison view for this push. Not present for builds that are triggered by GitHub pushes. CIRCLE_BUILD_NUM The build number, same as in circleci.com/gh/foo/bar/123 CIRCLE_PREVIOUS_BUILD_NUM The build number of the previous build, same as in circleci.com/gh/foo/bar/123 CI_PULL_REQUESTS Comma-separated list of pull requests this build is a part of. CI_PULL_REQUEST If this build is part of only one pull request, its URL will be populated here. If there was more than one pull request, it will contain one of the pull request URLs (picked randomly). CIRCLE_ARTIFACTS The directory whose contents are automatically saved as build artifacts. CIRCLE_USERNAME The GitHub login of the user who either pushed the code to GitHub or triggered the build from the UI/API. CIRCLE_TEST_REPORTS The directory whose contents are automatically processed as JUnit test metadata.
func (*Build) ExportEnvironments ¶
func (*Build) FetchBuildArtifacts ¶
func (this *Build) FetchBuildArtifacts(buildNum int, filter BuildArtifactFilter) ([]BuildArtifact, error)
type BuildArtifact ¶
type BuildArtifactFilter ¶
type BuildArtifactFilter func(*BuildArtifact) bool
func MatchPathAndBinary ¶
func MatchPathAndBinary(path, binary string) (BuildArtifactFilter, error)
type CircleYml ¶
type CircleYml struct { Machine Machine `yaml:"machine,omitempty"` Dependencies Block `yaml:"dependencies,omitempty"` Test Block `yaml:"test,omitempty"` Deployment Targets `yaml:"deployment,omitempty"` }
func (*CircleYml) LoadFromBytes ¶
type Deployment ¶
type EnvironmentMap ¶
type Machine ¶
type Machine struct { Services []string `yaml:"services,omitempty"` Timezone string `yaml:"timezone,omitempty"` Hosts HostMap `yaml:"hosts,omitempty"` Environment EnvironmentMap `yaml:"environment,omitempty"` }
type Targets ¶
type Targets map[string]Deployment