models

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetWorkSpacePath

func GetWorkSpacePath(project *Project) string

func NewBuild

func NewBuild(project *Project)

func RunScript added in v0.0.2

func RunScript(result bytes.Buffer, cmdList []*exec.Cmd) error

Types

type Build

type Build struct {
	Id        int      `orm:"pk;auto;unique" json:"id"` //主键
	Name      string   `json:"name" json:"name"`
	Result    string   `json:"result" json:"result"`
	Project   *Project `orm:"rel(fk)" json:"-"`
	IsSuccess bool     `json:"is_success"`
}

type BuildConfig

type BuildConfig struct {
	GetList      []string `json:"get_list"`      //Go get list
	ZipList      []string `json:"zip_list"`      //需要打包的文件
	AfterScript  string   `json:"after_script"`  //build 之后
	BeforeScript string   `json:"before_script"` //build 之前
}

type GithubHook added in v0.0.2

type GithubHook struct {
	Ref string `json:"ref"`
}

Github config

type GitlabHook

type GitlabHook struct {
	ObjectKind    string         `json:"object_kind"`
	EventName     string         `json:"event_name"`
	Ref           string         `json:"ref"`
	GitlabProject *GitlabProject `json:"project"`
}

Gitlab config

type GitlabProject

type GitlabProject struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	WebUrl      string `json:"web_url"`
	AvatarUrl   string `json:"avatar_url"`
	GitSshUrl   string `json:"git_ssh_url"`
	GitHttpUrl  string `json:"git_http_url"`
}

type Project

type Project struct {
	Id          int      `orm:"pk;auto;unique" json:"id"`
	ProjectId   string   `json:"project_id"`                 //uuid
	Name        string   `json:"name" form:"name"`           //name
	Type        string   `json:"type" form:"type"`           //github,gitlab
	Url         string   `json:"url" form:"url"`             //仓库地址
	Path        string   `json:"path" form:"path"`           //file 地址
	Branch      string   `json:"branch" form:"branch"`       //分支
	MainPath    string   `json:"main_path" form:"main_path"` //main 文件地址
	SecretToken string   `json:"secret_token" form:"secret_token"`
	Build       []*Build `orm:"reverse(many)" json:"-"`
}

func GetList

func GetList(page int, pageSize int) []*Project

func (*Project) Add

func (obj *Project) Add() (string, error)

return id,err

func (*Project) Delete

func (obj *Project) Delete() error

return id,err

func (*Project) Get

func (obj *Project) Get() error

return obj list,err

func (*Project) Update

func (obj *Project) Update() error

return isSuccess,err

Jump to

Keyboard shortcuts

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