func createBuildConfig(t *testing.T, buildConfigInterface client.BuildConfigInterface, strategy string) (*buildapi.BuildConfig, error) {
	buildConfig := &buildapi.BuildConfig{}
	buildConfig.GenerateName = strings.ToLower(string(strategy)) + "-buildconfig-"
	buildConfig.Spec.Strategy = strategyForType(strategy)
	buildConfig.Spec.Source.Git = &buildapi.GitBuildSource{URI: "example.org"}

	return buildConfigInterface.Create(buildConfig)
}
Example #2
0
func createDockerBuildConfig(t *testing.T, buildConfigInterface client.BuildConfigInterface) (*buildapi.BuildConfig, error) {
	dockerBuild := &buildapi.BuildConfig{}
	dockerBuild.GenerateName = "docker-buildconfig-"
	dockerBuild.Spec.Strategy.Type = buildapi.DockerBuildStrategyType
	dockerBuild.Spec.Source.Type = buildapi.BuildSourceGit
	dockerBuild.Spec.Source.Git = &buildapi.GitBuildSource{URI: "example.org"}

	return buildConfigInterface.Create(dockerBuild)
}
Example #3
0
func createCustomBuildConfig(t *testing.T, buildConfigInterface client.BuildConfigInterface) (*buildapi.BuildConfig, error) {
	dockerBuild := &buildapi.BuildConfig{}
	dockerBuild.GenerateName = "custom-buildconfig-"
	dockerBuild.Spec.Strategy.Type = buildapi.CustomBuildStrategyType
	dockerBuild.Spec.Strategy.CustomStrategy = &buildapi.CustomBuildStrategy{From: kapi.ObjectReference{Name: "name:tag"}}
	dockerBuild.Spec.Source.Type = buildapi.BuildSourceGit
	dockerBuild.Spec.Source.Git = &buildapi.GitBuildSource{URI: "example.org"}

	return buildConfigInterface.Create(dockerBuild)
}