Documentation
¶
Index ¶
- Constants
- func WithTaskStore(q queue.Queue, s TaskStore) queue.Queue
- func WithTaskStoreRedis(q queue.Queue, s TaskStore) queue.Queue
- type Build
- type Config
- type ConfigStore
- type File
- type FileStore
- type LogData
- type Netrc
- type Proc
- type ProcStore
- type Registry
- type Repo
- type RepoLite
- type ResourceLimit
- type ScmAccount
- type Secret
- type Task
- type TaskStore
Constants ¶
const ( EventPush = "push" EventPull = "pull_request" EventTag = "tag" EventManual = "manual" )
const ( BuildManual = "manual" BuildFork = "fork" BuildRerun = "rerun" )
const ( StatusSkipped = "skipped" StatusPending = "pending" StatusRunning = "running" StatusSuccess = "success" StatusFailure = "failure" StatusKilled = "killed" StatusError = "error" StatusBlocked = "blocked" StatusDeclined = "declined" )
const ( VisibilityPublic = "public" VisibilityPrivate = "private" VisibilityInternal = "internal" )
example: gitlab project have these three project type.
const (
RepoGit = "git"
)
Variables ¶
This section is empty.
Functions ¶
func WithTaskStore ¶
WithTaskStore returns a queue that is backed by the TaskStore. This ensures the task Queue can be restored when the system starts.
Types ¶
type Build ¶
type Build struct {
ID int64 `json:"id" meddler:"build_id,pk"`
RepoID int64 `json:"-" meddler:"build_repo_id"`
ConfigID int64 `json:"-" meddler:"build_config_id"`
Number int `json:"number" meddler:"build_number"`
Event string `json:"event" meddler:"build_event"`
Status string `json:"status" meddler:"build_status"`
Error string `json:"error" meddler:"build_error"`
Created int64 `json:"created_at" meddler:"build_created"`
Started int64 `json:"started_at" meddler:"build_started"`
Enqueued int64 `json:"enqueued_at" meddler:"build_enqueued"`
Finished int64 `json:"finished_at" meddler:"build_finished"`
Link string `json:"link_url" meddler:"build_link"`
Commit string `json:"commit" meddler:"build_commit"`
Branch string `json:"branch" meddler:"build_branch"`
Ref string `json:"ref" meddler:"build_ref"`
Refspec string `json:"refspec" meddler:"build_refspec"`
Remote string `json:"remote" meddler:"build_remote"`
Procs []*Proc `json:"procs,omitempty" meddler:"-"`
}
swagger:model build
type Config ¶
type Config struct {
ID int64 `json:"-" meddler:"config_id,pk"`
RepoID int64 `json:"-" meddler:"config_repo_id"`
Data string `json:"data" meddler:"config_data"`
Hash string `json:"hash" meddler:"config_hash"`
}
Config represents a pipeline configuration.
type ConfigStore ¶
ConfigStore persists pipeline configuration to storage. Often access by handler.Config.Storage.Config
type File ¶
type File struct {
ID int64 `json:"id" meddler:"file_id,pk"`
BuildID int64 `json:"build_id" meddler:"file_build_id"`
ProcID int64 `json:"proc_id" meddler:"file_proc_id"`
Name string `json:"name" meddler:"file_name"`
Size int `json:"size" meddler:"file_size"`
Mime string `json:"mime" meddler:"file_mime"`
Time int64 `json:"time" meddler:"file_time"`
}
File represents a pipeline artifact.
type FileStore ¶
type FileStore interface {
FileList(*Build) ([]*File, error)
FileFind(*Proc, string) (*File, error)
FileRead(*Proc, string) (io.ReadCloser, error)
FileCreate(*File, io.Reader) error
}
FileStore persists pipeline artifacts to storage.
type Proc ¶
type Proc struct {
ID int64 `json:"id" meddler:"proc_id,pk"`
BuildID int64 `json:"build_id" meddler:"proc_build_id"`
PID int `json:"pid" meddler:"proc_pid"`
PPID int `json:"ppid" meddler:"proc_ppid"`
PGID int `json:"pgid" meddler:"proc_pgid"`
Name string `json:"name" meddler:"proc_name"`
State string `json:"state" meddler:"proc_state"`
Error string `json:"error,omitempty" meddler:"proc_error"`
ExitCode int `json:"exit_code" meddler:"proc_exit_code"`
Started int64 `json:"start_time,omitempty" meddler:"proc_started"`
Stopped int64 `json:"end_time,omitempty" meddler:"proc_stopped"`
Machine string `json:"machine,omitempty" meddler:"proc_machine"`
Platform string `json:"platform,omitempty" meddler:"proc_platform"`
Environ map[string]string `json:"environ,omitempty" meddler:"proc_environ,json"`
Children []*Proc `json:"children,omitempty" meddler:"-"`
}
Proc represents a process in the build pipeline. swagger:model proc
type ProcStore ¶
type ProcStore interface {
ProcLoad(int64) (*Proc, error)
ProcFind(*Build, int) (*Proc, error)
ProcChild(*Build, int, string) (*Proc, error)
ProcList(*Build) ([]*Proc, error)
ProcCreate([]*Proc) error
ProcUpdate(*Proc) error
ProcClear(*Build) error
}
ProcStore persists process information to storage.
type Registry ¶
type Registry struct {
ID int64 `json:"id" meddler:"registry_id,pk"`
RepoID int64 `json:"-" meddler:"registry_repo_id"`
Address string `json:"address" meddler:"registry_addr"`
Username string `json:"username" meddler:"registry_username"`
Password string `json:"password" meddler:"registry_password"`
Email string `json:"email" meddler:"registry_email"`
Token string `json:"token" meddler:"registry_token"`
}
Registry represents a docker registry with credentials. swagger:model registry
type Repo ¶
type Repo struct {
ID int64 `json:"id,omitempty" meddler:"repo_id,pk"`
ScmId int64 `json:"-" meddler:"repo_scm_id"`
Owner string `json:"owner,omitempty" meddler:"repo_owner"`
FullName string `json:"full_name" meddler:"repo_full_name"`
Link string `json:"link_url,omitempty" meddler:"repo_link"`
Name string `json:"name,omitempty" meddler:"repo_name"`
Clone string `json:"clone_url,omitempty" meddler:"repo_clone"`
Branch string `json:"default_branch,omitempty" meddler:"repo_branch"`
Timeout int64 `json:"timeout,omitempty" meddler:"repo_timeout"`
IsPrivate bool `json:"private,omitempty" meddler:"repo_private"`
AllowPull bool `json:"allow_pr" meddler:"repo_allow_pr"`
AllowPush bool `json:"allow_push" meddler:"repo_allow_push"`
AllowTag bool `json:"allow_tags" meddler:"repo_allow_tags"`
AllowManual bool `json:"allow_manual" meddler:"repo_allow_manual"`
Counter int `json:"last_build" meddler:"repo_counter"`
Hash string `json:"-" meddler:"repo_hash"`
}
swagger:model build
type ResourceLimit ¶
type ResourceLimit struct {
MemSwapLimit int64
MemLimit int64
ShmSize int64
CPUQuota int64
CPUSet string
}
ResourceLimit is the resource limit to set on pipeline steps
type ScmAccount ¶
type ScmAccount struct {
ID int64 `json:"id,omitempty" meddler:"scm_id,pk"`
Host string `json:"host,omitempty" meddler:"scm_host"`
Login string `json:"login,omitempty" meddler:"scm_login"`
Password string `json:"password,omitempty" meddler:"scm_password"`
PrivateToken string `json:"private_token,omitempty" meddler:"scm_private_token"`
Type string `json:"scm_type,omitempty" meddler:"scm_type"`
}
swagger:model build
type Secret ¶
type Secret struct {
ID int64 `json:"id" meddler:"secret_id,pk"`
RepoID int64 `json:"-" meddler:"secret_repo_id"`
Name string `json:"name" meddler:"secret_name"`
Value string `json:"value,omitempty" meddler:"secret_value"`
}
Secret represents a secret variable, such as a password or token. swagger:model registry