tools: Migrate remaining tools to gobin

Replace ./scripts/install_tool.sh with `gobin`, such that we have
consistent handling for all tools needed for build and consistent
versioning within ./tools/mod/go.mod.

Side changes:
  - Expose /scripts/fix.sh that fixes formatting and bom across modules
  - Expose *.sh variants of scripts like build and ./test (first step
towards replacement).
  - Make stderr output of commands explicit and make commands use
different color than callouts.
This commit is contained in:
Piotr Tabor
2020-10-13 19:30:22 +02:00
parent 061d8e8ead
commit bc9e433ca2
14 changed files with 226 additions and 92 deletions

19
scripts/fix.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e
source ./scripts/test_lib.sh
source ./scripts/updatebom.sh
function mod_tidy_fix {
run rm ./go.sum || return 2
run go mod tidy || return 2
}
log_callout -e "\nFixing etcd code for you...\n"
run_for_modules run go fmt || exit 2
run_for_modules mod_tidy_fix || exit 2
run_for_module tests bom_fix || exit 2
log_success -e "\nSUCCESS: etcd code is fixed :)"