deployment

package
v1.3.0-rc.0...-d217119 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Overview

Package deployment 部署相关操作

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildVolumeRootDir

func BuildVolumeRootDir(runtime *dbclient.Runtime) string

func Render

func Render(template string) string

Types

type DeployFSMContext

type DeployFSMContext struct {
	Deployment        *dbclient.Deployment
	Runtime           *dbclient.Runtime
	Cluster           *clusterpb.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, releaseSvc pb.ReleaseServiceServer, serviceGroupImpl servicegroup.ServiceGroup, scheduler *scheduler.Scheduler, envConfig *environment.EnvConfig, clusterSvc clusterpb.ClusterServiceServer) *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) FetchDeploymentConfig

func (fsm *DeployFSMContext) FetchDeploymentConfig(namespace string) (map[string]string, map[string]string, error)

func (*DeployFSMContext) FetchDeploymentConfigDetail

func (fsm *DeployFSMContext) FetchDeploymentConfigDetail(namespace string) ([]apistructs.EnvConfig, []apistructs.EnvConfig, error)

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的数据信息

func (*DeployFSMContext) UpdateDeploymentStatusToRuntimeAndOrder

func (fsm *DeployFSMContext) UpdateDeploymentStatusToRuntimeAndOrder() error

func (*DeployFSMContext) UpdateServiceGroupWithLoop

func (fsm *DeployFSMContext) UpdateServiceGroupWithLoop(group apistructs.ServiceGroupCreateV2Request) error

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) ListAllDeployments

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

ListAllDeployments 查询所有部署记录列表

func (*Deployment) ListOrg

func (d *Deployment) ListOrg(ctx context.Context, 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 WithClusterSvc

func WithClusterSvc(clusterSvc clusterpb.ClusterServiceServer) Option

func WithDBClient

func WithDBClient(db *dbclient.DBClient) Option

WithDBClient 配置 db client

func WithEncrypt

func WithEncrypt(encrypt *encryption.EnvEncrypt) Option

WithEncrypt 配置 encrypt service

func WithEnvConfig

func WithEnvConfig(envConfig *environment.EnvConfig) Option

func WithEventManager

func WithEventManager(evMgr *events.EventManager) Option

WithEventManager 配置 EventManager

func WithMigration

func WithMigration(m *migration.Migration) Option

WithMigration 配置 Migration service

func WithReleaseSvc

func WithReleaseSvc(releaseSvc pb.ReleaseServiceServer) Option

WithReleaseSvc 配置 dicehub release service

func WithResource

func WithResource(resource *resource.Resource) Option

WithResource 配置 Runtime service

func WithScheduler

func WithScheduler(scheduler *scheduler.Scheduler) Option

func WithServiceGroup

func WithServiceGroup(serviceGroupImpl servicegroup.ServiceGroup) Option

Jump to

Keyboard shortcuts

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