components

package
v0.0.0-...-0deb007 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const SSHREMOTETIMEOUT = 600
View Source
const SSHTIMEOUT = 3600
View Source
const SSHWorker = 10

Variables

This section is empty.

Functions

This section is empty.

Types

type BasJenkins

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

func (*BasJenkins) GetCommitList

func (c *BasJenkins) GetCommitList(count int) ([]JenkinData, error)

func (*BasJenkins) SetBaseComponents

func (c *BasJenkins) SetBaseComponents(b BaseComponents)

type BaseComponents

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

func (*BaseComponents) CleanUpLocal

func (c *BaseComponents) CleanUpLocal(version string) error

*

  • 清理空间

func (*BaseComponents) CleanUpReleasesVersion

func (c *BaseComponents) CleanUpReleasesVersion(versions []string) error

*

  • 清理远端空间

func (*BaseComponents) CopyFiles

func (c *BaseComponents) CopyFiles() error

*

  • 将多个文件/目录传输到指定的多个目标机

func (*BaseComponents) GetAllHost

func (c *BaseComponents) GetAllHost() []string

*

  • 获取host ip加端口

func (*BaseComponents) GetDeployFromDir

func (c *BaseComponents) GetDeployFromDir() string

*

  • 拼接宿主机的仓库目录
  • {deploy_from}/{env}/{project}

func (*BaseComponents) GetExecFlush

func (c *BaseComponents) GetExecFlush() error

func (*BaseComponents) GetGitLog

func (c *BaseComponents) GetGitLog() error

func (*BaseComponents) GetGitProjectName

func (c *BaseComponents) GetGitProjectName(gitUrl string) string

根据git地址获取项目名字

func (*BaseComponents) GetGitPull

func (c *BaseComponents) GetGitPull() error

func (*BaseComponents) GetGroupHost

func (c *BaseComponents) GetGroupHost() map[int]string

func (*BaseComponents) GetHostIps

func (c *BaseComponents) GetHostIps() []string

*

  • 获取host ip

func (*BaseComponents) GetHosts

func (c *BaseComponents) GetHosts() []HostInfo

func (*BaseComponents) GetHosts_database

func (c *BaseComponents) GetHosts_database() []HostInfo

*

  • 获取host

func (*BaseComponents) GetHosts_jumpserver

func (c *BaseComponents) GetHosts_jumpserver() []HostInfo

func (*BaseComponents) GetLinkCommand

func (c *BaseComponents) GetLinkCommand(version string) string

*

  • 打软链

func (*BaseComponents) InitLocalWorkspace

func (c *BaseComponents) InitLocalWorkspace(version string) error

*

  • 初始化宿主机部署工作空间 *

func (*BaseComponents) InitRemoteVersion

func (c *BaseComponents) InitRemoteVersion(version string) error

*

  • 目标机器的版本库初始化

func (*BaseComponents) LastDeploy

func (c *BaseComponents) LastDeploy(version string) error

func (*BaseComponents) LogTaskCommond

func (c *BaseComponents) LogTaskCommond(value interface{})

func (*BaseComponents) PostDeploy

func (c *BaseComponents) PostDeploy(version string) error

func (*BaseComponents) PreDeploy

func (c *BaseComponents) PreDeploy(version string) error

func (*BaseComponents) RemoveLocalProjectWorkspace

func (c *BaseComponents) RemoveLocalProjectWorkspace() error

*

  • 清理项目目录 *

func (*BaseComponents) SaveRecord

func (c *BaseComponents) SaveRecord(command string) int

func (*BaseComponents) SaveRecordRes

func (c *BaseComponents) SaveRecordRes(id int, duration int, createdAt int, status int, value interface{})

func (*BaseComponents) SendP2pAgent

func (c *BaseComponents) SendP2pAgent(dirAgentPath string, destPath string) error

*

  • 发送p2p客户端并启动 *

func (*BaseComponents) SetProject

func (c *BaseComponents) SetProject(project *models.Project)

func (*BaseComponents) SetTask

func (c *BaseComponents) SetTask(task *models.Task)

func (*BaseComponents) StartP2pAgent

func (c *BaseComponents) StartP2pAgent(ips []string, destPath string) error

func (*BaseComponents) TestReleaseDir

func (c *BaseComponents) TestReleaseDir() error

*

  • 检测php用户是否具有目标机release目录读写权限 *

func (*BaseComponents) TestSsh

func (c *BaseComponents) TestSsh() error

*

  • 测试ssh连接 *

func (*BaseComponents) UpdateRemoteServers

func (c *BaseComponents) UpdateRemoteServers(version string) error

type BaseFile

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

func (*BaseFile) CheckFiles

func (c *BaseFile) CheckFiles(url string, fileDir string) ([]map[string]string, error)

*

  • 查询文件md5 *

func (*BaseFile) SetBaseComponents

func (c *BaseFile) SetBaseComponents(b BaseComponents)

func (*BaseFile) UpdateRepo

func (c *BaseFile) UpdateRepo(url string, fileDir string) error

func (*BaseFile) UpdateToVersion

func (c *BaseFile) UpdateToVersion() error

*

  • 更新到指定commit版本

type BaseGit

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

func (*BaseGit) DiffBetweenCommits

func (c *BaseGit) DiffBetweenCommits(branch string, commitIdNew string, commitIdOld string) ([]string, error)

func (*BaseGit) GetBranchList

func (c *BaseGit) GetBranchList() ([]map[string]string, error)

*

  • 获取分支列表

func (*BaseGit) GetCommitList

func (c *BaseGit) GetCommitList(branch string, count int) ([]map[string]string, error)

*

  • 获取提交历史 *

func (*BaseGit) GetLastModifyInfo

func (c *BaseGit) GetLastModifyInfo(branch string, filepath string) (map[string]string, error)

func (*BaseGit) GetTagList

func (c *BaseGit) GetTagList(count int) ([]map[string]string, error)

*

  • 获取tag记录 *

func (*BaseGit) SetBaseComponents

func (c *BaseGit) SetBaseComponents(b BaseComponents)

func (*BaseGit) UpdateRepo

func (c *BaseGit) UpdateRepo(branch string, gitDir string) error

func (*BaseGit) UpdateToVersion

func (c *BaseGit) UpdateToVersion() error

*

  • 更新到指定commit版本

type HostInfo

type HostInfo struct {
	Ip      string
	Group   int
	Port    int
	AllHost string
}

type JenkinData

type JenkinData struct {
	Build  string      `json:"build"`
	TarUrl string      `json:"tar_url"`
	MD5    interface{} `json:"md5"`
}

*

  • 获取提交历史 *

type Ldap

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

Jump to

Keyboard shortcuts

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