deployment

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2021 License: AGPL-3.0 Imports: 31 Imported by: 0

Documentation

Overview

Package deployment 部署相关操作

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeployFSMContext

type DeployFSMContext struct {
	Deployment        *dbclient.Deployment
	Runtime           *dbclient.Runtime
	Cluster           *apistructs.ClusterInfo
	App               *apistructs.ApplicationDTO
	Spec              *diceyml.Object
	ProjectNamespaces map[string]string
	// contains filtered or unexported fields
}

func NewFSMContext

func NewFSMContext(deploymentID uint64, db *dbclient.DBClient, evMgr *events.EventManager, bdl *bundle.Bundle, a *addon.Addon, m *migration.Migration, encrypt *encryption.EnvEncrypt, resource *resource.Resource) *DeployFSMContext

TODO: context should base on deployment service

func (*DeployFSMContext) ExportLogInfoDetail

func (fsm *DeployFSMContext) ExportLogInfoDetail(level apistructs.ErrorLogLevel, id string, humanlog, detaillog string)

func (*DeployFSMContext) GetProjectNamespace

func (fsm *DeployFSMContext) GetProjectNamespace(workspace string) string

GetProjectNamespace 获取项目命名空间

func (*DeployFSMContext) IsEnabledProjectNamespace

func (fsm *DeployFSMContext) IsEnabledProjectNamespace() bool

IsEnabledProjectNamespace 是否开启了项目命名空间

func (*DeployFSMContext) Load

func (fsm *DeployFSMContext) Load() error

func (*DeployFSMContext) PrepareCheckProjectResource

func (fsm *DeployFSMContext) PrepareCheckProjectResource(app *apistructs.ApplicationDTO, projectID uint64, legacyDice *diceyml.Object, runtime *dbclient.Runtime) (float64, float64, error)

prepareCheckProjectResource 计算项目预留资源,是否满足发布徐局

func (*DeployFSMContext) PutHepaService

func (fsm *DeployFSMContext) PutHepaService() error

putHepaService 发送给hepa的数据信息

type Deployment

type Deployment struct {
	// contains filtered or unexported fields
}

Deployment 部署对象封装

func New

func New(options ...Option) *Deployment

New 新建部署对象实例

func (*Deployment) Approve

func (d *Deployment) Approve(userID user.ID, orgID uint64, deploymentID uint64, reject bool, reason string, referer string) error

func (*Deployment) CancelLastDeploy

func (d *Deployment) CancelLastDeploy(runtimeID uint64, operator string, force bool) error

func (*Deployment) ContinueDeploy

func (d *Deployment) ContinueDeploy(deploymentID uint64) error

func (*Deployment) DeployStageAddons

func (d *Deployment) DeployStageAddons(deploymentID uint64) (*apistructs.DeploymentCreateResponseDTO, error)

func (*Deployment) DeployStageDomains

func (d *Deployment) DeployStageDomains(deploymentID uint64) (*apistructs.DeploymentCreateResponseDTO, error)

func (*Deployment) DeployStageServices

func (d *Deployment) DeployStageServices(deploymentID uint64) (*apistructs.DeploymentCreateResponseDTO, error)

func (*Deployment) GetStatus

func (d *Deployment) GetStatus(deploymentID uint64) (*apistructs.DeploymentStatusDTO, error)

GetStatus 查询部署状态

func (*Deployment) List

func (d *Deployment) List(userID user.ID, orgID uint64, runtimeID uint64, statuses []string, page apistructs.PageInfo) (
	*apistructs.DeploymentListData, error)

List 查询部署记录列表

func (*Deployment) ListOrg

func (d *Deployment) ListOrg(userID user.ID, orgID uint64, needFilterProjectRole bool,
	needApproval *bool, approvedBy *user.ID, operateUsers []string, approved *bool,
	approvalStatus *string, types []string, ids []uint64, page apistructs.PageInfo) (
	*apistructs.DeploymentDetailListData, error)

ListOrg 查询部署记录(列出orgid下所有有权限的deployments)

type Option

type Option func(*Deployment)

Option 部署对象配置选项

func WithAddon

func WithAddon(a *addon.Addon) Option

WithAddon 配置 addon service

func WithBundle

func WithBundle(bdl *bundle.Bundle) Option

WithBundle 配置 bundle

func WithDBClient

func WithDBClient(db *dbclient.DBClient) Option

WithDBClient 配置 db client

func WithEncrypt

func WithEncrypt(encrypt *encryption.EnvEncrypt) Option

WithEncrypt 配置 encrypt service

func WithEventManager

func WithEventManager(evMgr *events.EventManager) Option

WithEventManager 配置 EventManager

func WithMigration

func WithMigration(m *migration.Migration) Option

WithMigration 配置 Migration service

func WithResource

func WithResource(resource *resource.Resource) Option

WithResource 配置 Runtime service

Jump to

Keyboard shortcuts

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