コード例 #1
0
ファイル: build.go プロジェクト: wercker/wercker
// 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())
}
コード例 #2
0
ファイル: deploy.go プロジェクト: wercker/wercker
// 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())
}
コード例 #3
0
ファイル: build.go プロジェクト: hughker/wercker
// 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())
}