func main()

in versioning/scripts/cloudbuild/main.go [323:351]


func main() {
	config := versions.LoadConfig("versions.yaml", "cloudbuild")
	registryPtr := config.StringOption("registry", "gcr.io/$PROJECT_ID", "Registry, e.g: 'gcr.io/my-project'")
	dirsPtr := config.StringOption("dirs", "", "Comma separated list of Dockerfile dirs to use.")
	testsPtr := config.BoolOption("tests", true, "Run tests.")
	newTagsPtr := config.BoolOption("new_tags", false, "Require that image tags do not already exist.")
	firstTagOnly := config.BoolOption("first_tag", false, "Build only the first per version.")
	timeoutPtr := config.IntOption("timeout", 0, "Timeout in seconds. If not set, the default Cloud Build timeout is used.")
	enableParallel := config.BoolOption("enable_parallel", false, "Enable parallel build and bigger VM")
	forceParallel := config.BoolOption("force_parallel", false, "Force parallel build and bigger VM")
	config.Parse()

	if *registryPtr == "" {
		log.Fatalf("--registry flag is required")
	}

	if strings.Contains(*registryPtr, ":") {
		*registryPtr = strings.Replace(*registryPtr, ":", "/", 1)
	}

	var dirs []string
	if *dirsPtr != "" {
		dirs = strings.Split(*dirsPtr, ",")
	}
	spec := versions.LoadVersions("versions.yaml")
	options := cloudBuildOptions{dirs, *testsPtr, *newTagsPtr, *firstTagOnly, *timeoutPtr, *enableParallel, *forceParallel}
	result := renderCloudBuildConfig(*registryPtr, spec, options)
	fmt.Println(result)
}