project

package
v0.0.0-...-6bb069b Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: GPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearTmp

func ClearTmp(projectName string) int

func DeleteProject

func DeleteProject(projectName string, operator string) (code int)

func UpdateInfo

func UpdateInfo(projectName string,
	creator string,
	cluster string,
	defineDockerFileType string) (map[string]string, int)

Types

type PluggedProject

type PluggedProject struct {
	ProjectInfo
	DockerFileGenerator interfaces.Handler

	DockerfilePlugins *util.ConcurrentMap
	BuildPlugins      *util.ConcurrentMap
	// contains filtered or unexported fields
}

* 项目封装

func BuildPluginProject

func BuildPluginProject(projectName string,
	creator string,
	cluster string,
	defineDockerFileType string,
	createTime string,
	dockerfilePlugins *util.ConcurrentMap,
	buildPlugins *util.ConcurrentMap) *PluggedProject

构建project对象

func (*PluggedProject) AppendLog

func (p *PluggedProject) AppendLog(line string, logLevel string)

增加日志

func (*PluggedProject) BuildAndPushImage

func (p *PluggedProject) BuildAndPushImage(tag string, projectId int64) bool

构建镜像并推送镜像到Harobor仓库

func (*PluggedProject) BuildImage

func (p *PluggedProject) BuildImage() bool

构建镜像

func (*PluggedProject) ClearLog

func (p *PluggedProject) ClearLog()

清空日志

func (*PluggedProject) GetLog

func (p *PluggedProject) GetLog() string

获取日志

func (*PluggedProject) Init

func (p *PluggedProject) Init() bool

func (*PluggedProject) Save

func (p *PluggedProject) Save(configs []map[string]interface{}) bool

func (*PluggedProject) View

func (p *PluggedProject) View(lang string) string

type Project

type Project interface {
	Init() bool              // 初始化
	View(lang string) string // 返回project的页面数据
	Info() ProjectInfo
	BuildImage() bool                                   // 构建镜像
	BuildAndPushImage(tag string, projectId int64) bool // push镜像
	Save(configs []map[string]interface{}) bool         // 保存配置

	ClearLog()
	AppendLog(line string, logLevel string)
	GetLog() string
}

* 项目信息

func CloneProject

func CloneProject(srcProjectName string,
	dstProjectName string,
	creator string,
	cluster string,
	defineDockerFileType string,
	dockerfilePlugins *util.ConcurrentMap,
	buildPlugins *util.ConcurrentMap) (project Project, code int)

func NewProject

func NewProject(projectName string,
	creator string,
	cluster string,
	defineDockerFileType string,
	dockerfilePlugins *util.ConcurrentMap,
	buildPlugins *util.ConcurrentMap) (project Project, code int)

type ProjectInfo

type ProjectInfo struct {
	Creator              string `json:"creator"`
	Name                 string `json:"name"`
	CreateTime           string `json:"createTime"`
	LastModifyTime       string `json:"lastModifyTime"`
	LastModifyOperator   string `json:"lastModifyOperator"`
	Cluster              string `json:"Cluster"`
	DefineDockerFileType string `json:"DefineDockerFileType"`
}

* 项目信息

func BuildEmptyProjectInfo

func BuildEmptyProjectInfo() ProjectInfo

func (*ProjectInfo) Info

func (p *ProjectInfo) Info() ProjectInfo

type ProjectInfoList

type ProjectInfoList []ProjectInfo

排序使用

func (ProjectInfoList) Len

func (c ProjectInfoList) Len() int

func (ProjectInfoList) Less

func (c ProjectInfoList) Less(i, j int) bool

func (ProjectInfoList) Swap

func (c ProjectInfoList) Swap(i, j int)

type ProjectView

type ProjectView struct {
	DockerfileView plugin.PluginPipelineView
	BuildView      plugin.PluginPipelineView
}

* 项目视图

Jump to

Keyboard shortcuts

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