deploy

package
v0.0.0-...-fa8172e Latest Latest
Warning

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

Go to latest
Published: May 10, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STEP_PULL   = "pulling image"
	STEP_CREATE = "create container"
	STEP_START  = "start container"
)
View Source
const (
	STAGE_WAIT  = 0
	STAGE_DOING = 1
	STAGE_SUCC  = 2
	STAGE_ERR   = 3
	STAGE_BACK  = 4  //回滚状态
	STAGE_UNUSE = -1 //不修改stage状态
)
View Source
const (
	MACHINE_WAIT  = 0
	MACHINE_DOING = 1
	MACHINE_ERR   = 2
	MACHINE_SKIP  = 3
	MACHINE_SUCC  = 4
	MACHINE_BACK  = 5 //回滚状态
)
View Source
const (
	DeployType = 1
)

Variables

This section is empty.

Functions

func Deploy

func Deploy(dataId int64)

func GetMachineSum

func GetMachineSum(machineList MachineListJson) (int, int)

获取主机列表中总共的机器个数(用作百分比的分母)和已经部署成功的机器个数(用作百分比分子的基数)

func RewriteDeployHostList

func RewriteDeployHostList(deployId int64, stageId int, stageStatus int, machineId int, machineStatus int, logStrAdd string, progessStatus int)

修改并回写hostlist字段中的stage状态和machine状态

func RewriteDeployLog

func RewriteDeployLog(deployId int64, logStrAdd string)

func RewriteDeployStep

func RewriteDeployStep(deployId int64, stageId int, machineId int, step string)

修改并回写

Types

type CreateContainerJson

type CreateContainerJson struct {
	WorkerDir string   `json:"workdir"`
	HostName  string   `json:"hostname"`
	HostList  []string `json:"hostlist"`
	Env       []string `json:"env"`
	Volume    []string `json:"Volume"`
	Dns       []string `json:"dns"`
	Expose    []string `json:"expose"`
	Cmd       string   `json:"cmd"`
}

部署表中的dockerconfig 的json格式解析出来的object

type MachineJson

type MachineJson struct {
	Id            int64  `json:"id"`
	Step          string `json:"step"`
	Name          string `json:"name"`
	MachineStatus int    `json:"machine_status"`
}

type MachineListJson

type MachineListJson struct {
	Stage          []StageJson `json:"stage"`
	StageNum       int         `json:"stage_num"`
	ProgressStatus int         `json:"progress_status"`
}

部署表中机器列表的json

type StageJson

type StageJson struct {
	StageStatus int           `json:"stage_status"`
	Machine     []MachineJson `json:"machine"`
}

Jump to

Keyboard shortcuts

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