circleci

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2015 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PhaseMachine      = Phase("machine")
	PhaseDependencies = Phase("dependencies")
	PhaseTest         = Phase("test")
	PhaseDeployment   = Phase("deployment")
)
View Source
const CircleApiPrefix = "https://circleci.com/api/v1"

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Pre      []string `yaml:"pre,omitempty"`
	Override []string `yaml:"override,omitempty"`
}

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) Build

func (this *Build) Build(yml *CircleYml) error

func (*Build) ExportEnvironments

func (this *Build) ExportEnvironments() error

func (*Build) FetchBuildArtifacts

func (this *Build) FetchBuildArtifacts(buildNum int, filter BuildArtifactFilter) ([]BuildArtifact, error)

type BuildArtifact

type BuildArtifact struct {
	Path       string `json:"path,omitempty"`
	PrettyPath string `json:"pretty_path,omitempty"`
	URL        string `json:"url,omitempty"`
	Name       string `json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*BuildArtifact) Download

func (this *BuildArtifact) Download(dir string) (int64, error)

Downloads the artifact to the directory specified

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) AsJSON

func (this *CircleYml) AsJSON() ([]byte, error)

func (*CircleYml) AsYml

func (this *CircleYml) AsYml() ([]byte, error)

func (*CircleYml) LoadFromBytes

func (this *CircleYml) LoadFromBytes(buff []byte) error

func (*CircleYml) LoadFromReader

func (this *CircleYml) LoadFromReader(file io.Reader) error

type Deployment

type Deployment struct {
	Branch   string   `yaml:"branch,omitempty"`
	Commands []string `yaml:"commands,omitempty"`
}

type EnvironmentMap

type EnvironmentMap map[string]string

type HostMap

type HostMap map[string]string

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 Phase

type Phase string

type Targets

type Targets map[string]Deployment

Jump to

Keyboard shortcuts

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