当前位置: 首页>>代码示例>>Golang>>正文


Golang Config.HasCIConnection方法代码示例

本文整理汇总了Golang中github.com/jkellerer/jenkins-client-launcher/launcher/util.Config.HasCIConnection方法的典型用法代码示例。如果您正苦于以下问题:Golang Config.HasCIConnection方法的具体用法?Golang Config.HasCIConnection怎么用?Golang Config.HasCIConnection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/jkellerer/jenkins-client-launcher/launcher/util.Config的用法示例。


在下文中一共展示了Config.HasCIConnection方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: IsConfigAcceptable

func (self *FullGCInvoker) IsConfigAcceptable(config *util.Config) bool {
	if config.ForceFullGC && !config.HasCIConnection() {
		util.GOut("gc", "WARN: No Jenkins URI defined. System.GC() cannot be called inside the Jenkins client.")
		return false
	}
	return true
}
开发者ID:jkellerer,项目名称:jenkins-client-launcher,代码行数:7,代码来源:gc.go

示例2: Prepare

func (self *NodeNameHandler) Prepare(config *util.Config) {
	if !config.HasCIConnection() {
		return
	}

	if foundNode, err := self.verifyNodeName(config); err == nil {

		if !foundNode {
			if config.CreateClientIfMissing {
				if err := self.createNode(config); err == nil {
					util.GOut("naming", "Created node '%s' in Jenkins.", config.ClientName)
				} else {
					util.GOut("naming", "ERROR: Failed to create node '%s' in Jenkins. Cause: %v", config.ClientName, err)
				}
				foundNode, _ = self.verifyNodeName(config)
			} else {
				util.GOut("naming", "Will not attempt to auto generate node '%s' in Jenkins. Enable this with '-create' or within the configuration.", config.ClientName)
			}
		}

		if foundNode {
			util.GOut("naming", "Found client node name in Jenkins, using '%v'.", config.ClientName)
		} else {
			util.GOut("naming", "WARN: Client node name '%v' was %s in Jenkins. Likely the next operations will fail.", config.ClientName, "NOT FOUND")
		}
	} else {
		util.GOut("nameing", "ERROR: Failed to verify the client node name in Jenkins. Cause: %v", err)
	}
}
开发者ID:jkellerer,项目名称:jenkins-client-launcher,代码行数:29,代码来源:naming.go

示例3: IsConfigAcceptable

func (self *JenkinsNodeMonitor) IsConfigAcceptable(config *util.Config) bool {
	if config.ClientMonitorStateOnServer && !config.HasCIConnection() {
		util.GOut("monitor", "No Jenkins URI defined. Cannot monitor this node within Jenkins.")
		return false
	}
	return true
}
开发者ID:jkellerer,项目名称:jenkins-client-launcher,代码行数:7,代码来源:monitor.go

示例4: IsConfigAcceptable

func (self *SSHTunnelEstablisher) IsConfigAcceptable(config *util.Config) bool {
	if config.CITunnelSSHEnabled && config.CITunnelSSHAddress == "" {
		util.GOut("ssh-tunnel", "WARN: SSH tunnel is enabled but SSH server address is empty.")
		return false
	}
	if config.CITunnelSSHAddress != "" && !config.HasCIConnection() {
		util.GOut("ssh-tunnel", "WARN: No Jenkins URI defined. SSH tunnel settings are not enough to connect to Jenkins.")
		return false
	}
	return true
}
开发者ID:jkellerer,项目名称:jenkins-client-launcher,代码行数:11,代码来源:sshtunnel.go

示例5: IsConfigAcceptable

func (self *ClientMode) IsConfigAcceptable(config *util.Config) bool {
	if !config.HasCIConnection() {
		util.GOut(self.Name(), "ERROR: No Jenkins URI defined. Cannot connect to the CI server.")
		return false
	}

	if config.SecretKey == "" && !self.isAuthCredentialsPassedViaCommandline(config) {
		if config.SecretKey = self.getSecretFromJenkins(config); config.SecretKey == "" {
			util.GOut(self.Name(), "ERROR: No secret key set for node %v and the attempt to fetch it from Jenkins failed.", config.ClientName)
			return false
		}
	}

	return true
}
开发者ID:jkellerer,项目名称:jenkins-client-launcher,代码行数:15,代码来源:client.go

示例6: Prepare

func (self *JenkinsClientDownloader) Prepare(config *util.Config) {
	util.ClientJar, _ = filepath.Abs(ClientJarName)

	modes.RegisterModeListener(func(mode modes.ExecutableMode, nextStatus int32, config *util.Config) {
		if mode.Name() == "client" && nextStatus == modes.ModeStarting && config.HasCIConnection() {
			if err := self.downloadJar(config); err != nil {
				jar, e := os.Open(ClientJarName)
				defer jar.Close()
				if os.IsNotExist(e) {
					panic(fmt.Sprintf("No jenkins client: %s", err))
				} else {
					util.GOut("DOWNLOAD", "%s", err)
				}
			}
		}
	})
}
开发者ID:jkellerer,项目名称:jenkins-client-launcher,代码行数:17,代码来源:clientjar.go


注:本文中的github.com/jkellerer/jenkins-client-launcher/launcher/util.Config.HasCIConnection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。