The controller imports mesh-host/validate through a replace onto the forge that holds it, and every build — the build agent's go build in a fresh toolchain container, the Dockerfile's go mod download — would have fetched it through the public proxy and checksum database at build time: a merge breaking main on the network, the class Phase 1 removes. vendor/ is committed; go builds from it with nothing fetched, and refuses to build when it and go.mod disagree, so a pin moved without go mod vendor fails at once. The Dockerfile copies vendor/ and builds with GOPROXY=off.
19 lines
463 B
Ruby
19 lines
463 B
Ruby
require "erb"
|
|
|
|
rule '.go' => '.go.erb' do |task|
|
|
erb = ERB.new(File.read(task.source))
|
|
File.write(task.name, "// Code generated from #{task.source}. DO NOT EDIT.\n\n" + erb.result(binding))
|
|
sh "goimports", "-w", task.name
|
|
end
|
|
|
|
generated_code_files = [
|
|
"pgtype/int.go",
|
|
"pgtype/int_test.go",
|
|
"pgtype/integration_benchmark_test.go",
|
|
"pgtype/zeronull/int.go",
|
|
"pgtype/zeronull/int_test.go"
|
|
]
|
|
|
|
desc "Generate code"
|
|
task generate: generated_code_files
|