Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBuildGet = errors.New("获取Build记录错误,请查询是否存在") ErrBuilding = errors.New("需要等上一个构建完成才能进行新的构建,你可以选择暂停") ErrBuildJenkinsJob = errors.New("Jenkins Build Job错误:") ErrBuildProjectGet = errors.New("项目获取失败,可能不存在或未审核") ErrBuildJenkinsJobGet = errors.New("Jenkins Job 获取错误: ") ErrBuildCreate = errors.New("创建Build记录错误,请联系管理员") ErrBuildQueuePublish = errors.New("构建入列出错了,请联系管理员") ErrBuildAbort = errors.New("终止错误,可能这个job状态已经是终止态") ErrBuildCount = errors.New("构建记录统计出错") ErrBuildList = errors.New("构建列表获取出错") ErrBuildDeploymentK8sGet = errors.New("基础信息获取错误") ErrBuildDeploymentK8sUpdate = errors.New("更新基础镜像出错") )
Functions ¶
func MakeHandler ¶
func MakeHandler(svc Service, logger log.Logger, repository repository.Repository) http.Handler
Types ¶
type Service ¶
type Service interface { // build 应用 Build(ctx context.Context, gitType, version, buildEnv, buildEnvDesc, buildTime string) error // 获取build输出的信息 BuildConsole(ctx context.Context, number, start int) (string, int, error) // 处理消费出来的 build 的数据 // desc: 如果还在build 或出有一点啥差错 重新放回队列 ReceiverBuild(ctx context.Context, data string) error // 终止构建 AbortBuild(ctx context.Context, jenkinsBuildId int) error // 获取build 记录 History(ctx context.Context, page, limit int) (map[string]interface{}, error) // 回滚版本 Rollback(ctx context.Context, buildId int64) error // 获取Jenkins build配置信息 BuildConf(ctx context.Context, ns, name string) (res interface{}, err error) // 获取cronjob build 记录 CronHistory(ctx context.Context, page, limit int) (map[string]interface{}, error) // 获取cronjob build输出的信息 CronBuildConsole(ctx context.Context, number, start int) (string, int, error) }
func NewService ¶
func NewService(logger log.Logger, jenkins jenkins.Jenkins, amqpClient amqpClient.AmqpClient, k8sClient kubernetes.K8sClient, config *config.Config, store repository.Repository, hookQueueSvc hooks.ServiceHookQueue) Service
Click to show internal directories.
Click to hide internal directories.