Documentation
¶
Index ¶
- type Artifact
- type Build
- type BuildTag
- type BuildVariable
- type GlobalVariable
- type Group
- type Pipeline
- type PipelineStage
- type PipelineVariable
- type RegisterToken
- type Runner
- type RunnerTag
- type Schedule
- type ScheduleVariable
- type Setting
- type Trace
- type TracePart
- type User
- type Variable
- type VueWebsocketMessage
- type Workflow
- type WorkflowVariable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Artifact ¶
type Artifact struct {
ID int64 `gorm:"primaryKey;autoIncrement:false" json:"id"`
Type string `json:"type"`
Format string `json:"format"`
File string `json:"file"`
Size int64 `json:"size"`
ExpiresAt *time.Time `json:"expires_at"`
BuildID int64 `json:"build_id"`
Build Build `gorm:"foreignKey:BuildID" json:"-"`
PipelineID int64 `json:"pipeline_id"`
Pipeline Pipeline `gorm:"foreignKey:PipelineID" json:"-"`
CreatedAt *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
}
Artifact --
type Build ¶
type Build struct {
ID int64 `gorm:"primaryKey;autoIncrement:false" json:"id"`
State string `json:"state"`
AllowFailure bool `json:"allow_failure"`
Dependencies string `json:"dependencies,omitempty"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
Name string `json:"name"`
Job string `json:"job" gorm:"uniqueIndex:pipeline_stage_instance,priority:4;size:256"`
Options datatypes.JSON `json:"-"` // map[string]string
QueuedAt *time.Time `json:"queued_at,omitempty"`
Stage string `json:"stage"`
StageIdx int64 `json:"stage_idx" gorm:"uniqueIndex:pipeline_stage_instance,priority:2"`
StartedAt *time.Time `json:"started_at,omitempty"`
Token string `json:"token"`
When string `json:"when"`
Data []byte `json:"data,omitempty"`
InstanceIdx int64 `json:"instance_idx" gorm:"default:0;uniqueIndex:pipeline_stage_instance,priority:3"`
Duration *int `json:"duration"`
Parallel int64 `json:"parallel" gorm:"default:0;uniqueIndex:pipeline_stage_instance,priority:5;size:256"`
Timeout *int `json:"timeout" gorm:"default:3600"`
FailureReason *string `json:"failure_reason,omitempty"`
Retried bool `json:"retried" gorm:"default:0"`
PipelineID int64 `json:"pipeline_id" gorm:"index"`
Pipeline Pipeline `` /* 148-byte string literal not displayed */
RunnerID *int64 `json:"runner_id"`
Runner *Runner `gorm:"foreignKey:RunnerID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" json:"-"`
Tags []BuildTag `json:"tags,omitempty"`
Variables []*BuildVariable `json:"variables,omitempty"`
Artifacts []*Artifact `json:"artifacts,omitempty"`
CreatedAt *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
}
Build --
type BuildTag ¶
type BuildTag struct {
Tag string `json:"tag" gorm:"size:64;uniqueIndex:build_tag"`
BuildID int64 `json:"-" gorm:"uniqueIndex:build_tag"`
Build Build `json:"-" gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE" json:"-"`
CreatedAt time.Time `json:"-"`
UpdatedAt time.Time `json:"-"`
}
BuildTag --
type BuildVariable ¶
type BuildVariable struct {
*Variable
BuildID int64 `gorm:"primaryKey" json:"build_id"`
Build Build `gorm:"foreignKey:BuildID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"-"`
}
BuildVariable defines variables that are merged into specific builds and dependent builds
type GlobalVariable ¶
type GlobalVariable struct {
*Variable
}
GlobalVariable define variables that are merged into all jobs
type Group ¶
type Group struct {
ID int64 `gorm:"primaryKey;autoIncrement:false" json:"id"`
Name string
CreatedAt *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
Users []*User `gorm:"many2many:user_groups"`
}
Group --
type Pipeline ¶
type Pipeline struct {
ID int64 `gorm:"primaryKey;autoIncrement:false" json:"id"`
Duration int `json:"duration,omitempty"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
StartedAt *time.Time `json:"started_at,omitempty"`
State string `json:"state"`
Data []byte `json:"data"`
WorkflowID int64 `json:"workflow_id"`
Workflow Workflow `json:"workflow" gorm:"foreignKey:WorkflowID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
CreatedAt *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
Builds []Build `json:"builds"`
Stages []PipelineStage `json:"stages"`
Variables []PipelineVariable `json:"variables,omitempty"`
}
Pipeline --
type PipelineStage ¶
type PipelineStage struct {
ID int64 `gorm:"primaryKey;autoIncrement:false" json:"id"`
Name string `json:"name" gorm:"size:16,uniqueIndex:stage"`
Index int64 `json:"index" gorm:"uniqueIndex:stage,sort:asc"`
State string `json:"state"`
PipelineID int64 `json:"pipeline_id" gorm:"uniqueIndex:stage"`
CreatedAt *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
}
PipelineStage --
func (*PipelineStage) AfterSave ¶
func (p *PipelineStage) AfterSave(tx *gorm.DB) error
AfterSave - sends channel notification
func (*PipelineStage) BeforeCreate ¶
func (p *PipelineStage) BeforeCreate(tx *gorm.DB) error
BeforeCreate --
type PipelineVariable ¶
type PipelineVariable struct {
*Variable
PipelineID int64 `gorm:"primaryKey" json:"pipeline_id"`
Pipeline Pipeline `gorm:"foreignKey:PipelineID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"-"`
}
PipelineVariable define variables that are merged into all pipeline builds
type RegisterToken ¶
type RegisterToken struct {
ID int64 `json:"id" gorm:"primaryKey;autoIncrement:false"`
Token string `json:"token"`
CreatedAt *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
}
RegisterToken --
func (*RegisterToken) BeforeCreate ¶
func (r *RegisterToken) BeforeCreate(tx *gorm.DB) error
BeforeCreate will generate a Snowflake ID
type Runner ¶
type Runner struct {
ID int64 `gorm:"primaryKey;autoIncrement:false" json:"id"`
Active bool `json:"active"`
Architecture string `json:"architecture"`
ContactedAt *time.Time `json:"contacted_at"`
Description string `json:"description"`
Global bool `json:"global"`
Locked bool `json:"locked"`
Name string `json:"name"`
Platform string `json:"platform"`
Token string `json:"token"`
Tags []RunnerTag `json:"tags,omitempty"` // []string
Version string `json:"version"`
RunUntagged bool `json:"run_untagged"`
CreatedAt *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
}
Runner --
type RunnerTag ¶
type RunnerTag struct {
Tag string `json:"tag" gorm:"primaryKey;size:64"`
RunnerID int64 `json:"runner_id" gorm:"primaryKey"`
Runner Runner `json:"runner" gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE" json:"-"`
CreatedAt time.Time
UpdatedAt time.Time
}
RunnerTag --
type Schedule ¶
type Schedule struct {
ID int64 `gorm:"primaryKey;autoIncrement:false" json:"id"`
Name string `json:"name"`
Cron string `json:"cron"`
Last *time.Time `json:"last"`
Next *time.Time `json:"next"`
WorkflowID int64 `json:"workflow_id"`
Workflow Workflow `gorm:"foreignKey:WorkflowID" json:"workflow"`
CreatedAt *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
}
Schedule --
func (*Schedule) BeforeCreate ¶
BeforeCreate will generate a Snowflake ID
type ScheduleVariable ¶
type ScheduleVariable struct {
*Variable
BuildID int64 `gorm:"primaryKey" json:"build_id"`
Build Build `gorm:"foreignKey:BuildID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"-"`
}
ScheduleVariable defines variables that are merged into pipelines when run by a schedule
type Setting ¶
type Setting struct {
*gorm.Model
Name string `json:"name" gorm:"primaryKey;autoIncrement:false"`
Value string `json:"value"`
}
Setting --
type Trace ¶
type Trace struct {
ID int64 `gorm:"primaryKey;autoIncrement:false" json:"id"`
BuildID int64 `gorm:"unique" json:"build_id"`
Build Build `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"build"`
CreatedAt *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
Parts []TracePart `json:"parts,omitempty"`
}
Trace --
type TracePart ¶
type TracePart struct {
ID int64 `gorm:"primaryKey;autoIncrement:false" json:"id"`
Start int `json:"start"`
End int `json:"end"`
Size int `json:"size"`
Data []byte `json:"data"`
TraceID int64 `json:"trace_id"`
Trace Trace `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"trace"`
CreatedAt *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
}
TracePart --
type User ¶
type User struct {
ID int64 `gorm:"primaryKey;autoIncrement:false" json:"id"`
Name string
Username string
Password string
Groups []*Group `gorm:"many2many:user_groups"`
CreatedAt *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
}
User --
type Variable ¶
type Variable struct {
Name string `gorm:"primaryKey;autoIncrement:false" json:"name"`
Value string `json:"value"`
Masked bool `json:"masked" gorm:"default:0"`
File bool `json:"file" gorm:"default:0"`
Internal bool `json:"internal" gorm:"default:0"`
Public bool `json:"public" gorm:"default:1"`
// TODO: switch to pointers?
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
Variable --
type VueWebsocketMessage ¶
type VueWebsocketMessage struct {
Namespace string `json:"namespace,omitempty"`
Mutation string `json:"mutation,omitempty"`
Action string `json:"action,omitempty"`
Data interface{} `json:"data"`
}
VueWebsocketMessage --
type Workflow ¶
type Workflow struct {
ID int64 `json:"id" gorm:"primaryKey;autoIncrement:false"`
Name string `json:"name" gorm:"uniqueIndex;size:256"`
Data string `json:"data,omitempty"`
CreatedAt *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
}
Workflow --
type WorkflowVariable ¶
type WorkflowVariable struct {
*Variable
WorkflowID int64 `gorm:"primaryKey" json:"workflow_id"`
Workflow Workflow `gorm:"foreignKey:WorkflowID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"-"`
}
WorkflowVariable define variables that are merged into all pipelines for a workflow