ci

package
v0.2.27 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValid

func IsValid(c CI) bool

Types

type Azure

type Azure struct {
	*Common
	CICommit     string `env:"BUILD_SOURCEVERSION"`
	CIBuildName  string `env:"BUILD_REPOSITORY_NAME"`
	CIBranchName string `env:"BUILD_SOURCEBRANCHNAME"`
}

func (Azure) Branch

func (c Azure) Branch() string

func (Azure) BranchReplaceSlash

func (c Azure) BranchReplaceSlash() string

func (Azure) BuildName

func (c Azure) BuildName() string

func (Azure) Commit

func (c Azure) Commit() string

func (Azure) Configured

func (c Azure) Configured() bool

func (Azure) Name

func (c Azure) Name() string

type Buildkite

type Buildkite struct {
	*Common
	CICommit     string `env:"BUILDKITE_COMMIT"`
	CIBuildName  string `env:"BUILDKITE_PIPELINE_SLUG"`
	CIBranchName string `env:"BUILDKITE_BRANCH"`
}

func (*Buildkite) Branch

func (c *Buildkite) Branch() string

func (*Buildkite) BranchReplaceSlash

func (c *Buildkite) BranchReplaceSlash() string

func (*Buildkite) BuildName

func (c *Buildkite) BuildName() string

func (*Buildkite) Commit

func (c *Buildkite) Commit() string

func (*Buildkite) Configured

func (c *Buildkite) Configured() bool

func (*Buildkite) Name

func (c *Buildkite) Name() string

type CI

type CI interface {
	Name() string
	// BuildName returns the name of the current build in lowercase
	BuildName() string
	Branch() string
	BranchReplaceSlash() string
	Commit() string
	SetVCS(vcs vcs.VCS)
	SetImageName(imageName string)
	Configured() bool
}

type Common

type Common struct {
	VCS       vcs.VCS
	ImageName string
}

func (*Common) Branch

func (c *Common) Branch(name string) string

func (*Common) BuildName

func (c *Common) BuildName(name string) string

func (*Common) Commit

func (c *Common) Commit(name string) string

func (*Common) SetImageName added in v0.2.5

func (c *Common) SetImageName(imageName string)

func (*Common) SetVCS

func (c *Common) SetVCS(vcs vcs.VCS)

type Github

type Github struct {
	*Common
	CICommit     string `env:"GITHUB_SHA"`
	CIBuildName  string `env:"RUNNER_WORKSPACE"`
	CIBranchName string `env:"GITHUB_REF"`
}

func (*Github) Branch

func (c *Github) Branch() string

func (*Github) BranchReplaceSlash

func (c *Github) BranchReplaceSlash() string

func (*Github) BuildName

func (c *Github) BuildName() string

func (*Github) Commit

func (c *Github) Commit() string

func (*Github) Configured

func (c *Github) Configured() bool

func (*Github) Name

func (c *Github) Name() string

type Gitlab

type Gitlab struct {
	*Common
	CICommit     string `env:"CI_COMMIT_SHA"`
	CIBuildName  string `env:"CI_PROJECT_NAME"`
	CIBranchName string `env:"CI_COMMIT_REF_NAME"`
}

func (*Gitlab) Branch

func (c *Gitlab) Branch() string

func (*Gitlab) BranchReplaceSlash

func (c *Gitlab) BranchReplaceSlash() string

func (*Gitlab) BuildName

func (c *Gitlab) BuildName() string

func (*Gitlab) Commit

func (c *Gitlab) Commit() string

func (*Gitlab) Configured

func (c *Gitlab) Configured() bool

func (*Gitlab) Name

func (c *Gitlab) Name() string

type No

type No struct {
	*Common
}

func (No) Branch

func (c No) Branch() string

func (No) BranchReplaceSlash

func (c No) BranchReplaceSlash() string

func (No) BuildName

func (c No) BuildName() string

func (No) Commit

func (c No) Commit() string

func (No) Configured

func (c No) Configured() bool

func (No) Name

func (c No) Name() string

type TeamCity

type TeamCity struct {
	*Common
	CICommit     string `env:"BUILD_VCS_NUMBER"`
	CIBuildName  string `env:"TEAMCITY_PROJECT_NAME"`
	CIBranchName string `env:"BUILD_VCS_BRANCH"`
}

func (TeamCity) Branch

func (c TeamCity) Branch() string

func (TeamCity) BranchReplaceSlash

func (c TeamCity) BranchReplaceSlash() string

func (TeamCity) BuildName

func (c TeamCity) BuildName() string

func (TeamCity) Commit

func (c TeamCity) Commit() string

func (TeamCity) Configured

func (c TeamCity) Configured() bool

func (TeamCity) Name

func (c TeamCity) Name() string

Jump to

Keyboard shortcuts

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