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


Golang Environment.GetMirror方法代码示例

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


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

示例1: InitEnv

// InitEnv sets up the internal state of the environment for the build
func (b *DockerBuild) InitEnv(hostEnv *util.Environment) {
	env := b.Env()

	a := [][]string{
		[]string{"BUILD", "true"},
		[]string{"CI", "true"},
		[]string{"WERCKER_RUN_ID", b.options.RunID},
		[]string{"WERCKER_RUN_URL", b.options.WorkflowURL()},
		[]string{"WERCKER_GIT_DOMAIN", b.options.GitDomain},
		[]string{"WERCKER_GIT_OWNER", b.options.GitOwner},
		[]string{"WERCKER_GIT_REPOSITORY", b.options.GitRepository},
		[]string{"WERCKER_GIT_BRANCH", b.options.GitBranch},
		[]string{"WERCKER_GIT_COMMIT", b.options.GitCommit},

		// Legacy env vars
		[]string{"WERCKER_BUILD_ID", b.options.RunID},
		[]string{"WERCKER_BUILD_URL", b.options.WorkflowURL()},
	}

	env.Update(b.CommonEnv())
	env.Update(a)
	env.Update(hostEnv.GetMirror())
	env.Update(hostEnv.GetPassthru().Ordered())
	env.Hidden.Update(hostEnv.GetHiddenPassthru().Ordered())
}
开发者ID:wercker,项目名称:wercker,代码行数:26,代码来源:build.go

示例2: InitEnv

// InitEnv sets up the internal state of the environment for the build
func (d *DockerDeploy) InitEnv(hostEnv *util.Environment) {
	env := d.Env()

	a := [][]string{
		[]string{"DEPLOY", "true"},
		[]string{"WERCKER_RUN_ID", d.options.RunID},
		[]string{"WERCKER_RUN_URL", d.options.WorkflowURL()},
		[]string{"WERCKER_GIT_DOMAIN", d.options.GitDomain},
		[]string{"WERCKER_GIT_OWNER", d.options.GitOwner},
		[]string{"WERCKER_GIT_REPOSITORY", d.options.GitRepository},
		[]string{"WERCKER_GIT_BRANCH", d.options.GitBranch},
		[]string{"WERCKER_GIT_COMMIT", d.options.GitCommit},

		// Legacy env vars
		[]string{"WERCKER_DEPLOY_ID", d.options.RunID},
		[]string{"WERCKER_DEPLOY_URL", d.options.WorkflowURL()},
	}

	if d.options.DeployTarget != "" {
		a = append(a, []string{"WERCKER_DEPLOYTARGET_NAME", d.options.DeployTarget})
	}

	env.Update(d.CommonEnv())
	env.Update(a)
	env.Update(hostEnv.GetMirror())
	env.Update(hostEnv.GetPassthru().Ordered())
	env.Hidden.Update(hostEnv.GetHiddenPassthru().Ordered())
}
开发者ID:wercker,项目名称:wercker,代码行数:29,代码来源:deploy.go

示例3: InitEnv

// InitEnv sets up the internal state of the environment for the build
func (b *DockerBuild) InitEnv(hostEnv *util.Environment) {
	env := b.Env()

	a := [][]string{
		[]string{"BUILD", "true"},
		[]string{"CI", "true"},
		[]string{"WERCKER_BUILD_ID", b.options.BuildID},
		[]string{"WERCKER_BUILD_URL", fmt.Sprintf("%s/#build/%s", b.options.BaseURL, b.options.BuildID)},
		[]string{"WERCKER_GIT_DOMAIN", b.options.GitDomain},
		[]string{"WERCKER_GIT_OWNER", b.options.GitOwner},
		[]string{"WERCKER_GIT_REPOSITORY", b.options.GitRepository},
		[]string{"WERCKER_GIT_BRANCH", b.options.GitBranch},
		[]string{"WERCKER_GIT_COMMIT", b.options.GitCommit},
	}

	env.Update(b.CommonEnv())
	env.Update(a)
	env.Update(hostEnv.GetMirror())
	env.Update(hostEnv.GetPassthru().Ordered())
	env.Hidden.Update(hostEnv.GetHiddenPassthru().Ordered())
}
开发者ID:hughker,项目名称:wercker,代码行数:22,代码来源:build.go


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