當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。