Documentation ¶
Index ¶
- Constants
- Variables
- func Close() error
- func Get() *storm.DB
- func Open(path string) error
- func ParseLuaScript(fn string, args string, src string) string
- func PurgeProjects(projects []*Project)
- type Build
- type Commit
- type EventBase
- type EvtCommitFound
- type EvtPipelineBegin
- type EvtPipelineFinished
- type EvtPipelineFound
- type EvtStageBegin
- type EvtStageFinish
- type EvtStageLog
- type Project
- func (p *Project) AssignId() error
- func (p *Project) CheckIntegrity()
- func (p *Project) CreateLuaVm() error
- func (p *Project) EvalTriggerFilter(body string) (bool, error)
- func (p *Project) GetLastBuild() (*Build, error)
- func (p *Project) GetPrivateKey() ([]byte, error)
- func (p *Project) GetRepository() string
- func (p *Project) IsMissconfigured() error
- func (p *Project) IsTriggerTokenValid(token string) bool
- func (p *Project) IsValid() bool
- func (p *Project) Lock() error
- func (p *Project) NewBuild() *Build
- func (p *Project) RunGc(artifacts string) error
- func (p *Project) Unlock()
- type ProjectMapping
- type Stage
Constants ¶
const ( // status of the whole build BUILD_WAITING = "waiting" BUILD_RUNNING = "running" BUILD_PASSED = "passed" BUILD_FAILED = "failed" // status of a single stage STAGE_IGNORED = "ignored" STAGE_RUNNING = "running" STAGE_FAILED = "failed" STAGE_PASSED = "passed" )
const ( TRIGGER_MANUAL = "manual" TRIGGER_POLL = "poll" KEY_PREFIX = "-----BEGIN" )
const (
LUA_TAG = "lua"
)
Variables ¶
var ( ErrBuildRunning = errors.New("build already running") ErrUnknownHash = errors.New("unknown hash") )
var ( // regular expressions ReFnAlias = regexp.MustCompile("^\\s*\\${(.*?)}\\s*$") )
Functions ¶
func ParseLuaScript ¶
Parses the lua script in an configuration property. Applies all custom syntax.
func PurgeProjects ¶
func PurgeProjects(projects []*Project)
Types ¶
type Build ¶
type Build struct { Id uint64 `json:"-" storm:"id,increment" groups:"queryall,one"` Project uint64 `json:"-" strom:"index"` Num int `json:"num" strom:"index" groups:"queryall,one"` Status string `json:"status" groups:"queryall,one"` Commit Commit `json:"commit" groups:"queryall,one"` Time time.Time `json:"time" groups:"queryall,one"` Duration time.Duration `json:"duration" groups:"queryall,one"` Node string `json:"node" groups:"queryall,one"` Stages []Stage `json:"stages" groups:"one"` }
func (*Build) GetArtifactName ¶
Get the local artifact name for this build in respect to the given basepath.
type EvtCommitFound ¶
type EvtPipelineBegin ¶
type EvtPipelineFinished ¶
type EvtPipelineFound ¶
type EvtStageBegin ¶
type EvtStageFinish ¶
type EvtStageLog ¶
type Project ¶
type Project struct { Id int `yaml:"-" json:"id"` Name string `yaml:"name,omitempty" json:"name"` Scm string `yaml:"scm,omitempty" json:"scm"` Repository string `yaml:"repo,omitempty" json:"repository"` Branch string `yaml:"branch,omitempty" json:"branch"` Trigger string `yaml:"trigger,omitempty" json:"trigger"` Interval int `yaml:"interval,omitempty" json:"interval"` TriggerTokens []string `yaml:"trigger_tokens,omitempty"` TriggerFilter string `yaml:"trigger_filter,omitempty" lua:"trigger_filter"` Env map[string]string `yaml:"env,omitempty" json:"env"` EnvSecret map[string]string `yaml:"env_secret,omitempty" json:"env_secret"` CommitUrl string `yaml:"commit_url,omitempty" json:"commit_url"` BadgeEnable bool `yaml:"badge" json:"badge"` KeepHistory int `yaml:"keep_history,omitempty"` Hash string `yaml:"hash,omitempty" json:"-"` PrivateKey string `yaml:"key,omitempty" json:"key"` // contains filtered or unexported fields }
func (*Project) CheckIntegrity ¶
func (p *Project) CheckIntegrity()
Checks the integrty of a project and corrects if necessary.
func (*Project) CreateLuaVm ¶
Creates a lua vm for this project.
func (*Project) EvalTriggerFilter ¶
Executes the trigger filter script.
func (*Project) GetLastBuild ¶
Gets the latest build of this project.
func (*Project) GetPrivateKey ¶
Returns the private key which is configured for the project. It is ether read from the given file or from the property itself.
func (*Project) GetRepository ¶
Returns the repository url for this project. A dummy username and password is inserted if no one is provided in the configuration file.
func (*Project) IsMissconfigured ¶
Returns an error if the project is missconfigured.
func (*Project) IsTriggerTokenValid ¶
Returns true if token is a valid token for this project.
func (*Project) IsValid ¶
Returns true if the project is valid and should be made available to the public.