forked from argoproj/argo-cd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: portable and simpler toolchain install (argoproj#7920)
Signed-off-by: Jesse Suen <[email protected]>
- Loading branch information
Showing
13 changed files
with
79 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,52 @@ | ||
#!/bin/bash | ||
set -eux -o pipefail | ||
|
||
GO111MODULE=on go get github.com/gogo/protobuf/[email protected] | ||
GO111MODULE=on go get sigs.k8s.io/controller-tools/cmd/[email protected] | ||
GO111MODULE=on go get github.com/golang/protobuf/[email protected] | ||
GO111MODULE=on go get github.com/grpc-ecosystem/grpc-gateway/[email protected] | ||
GO111MODULE=on go get github.com/grpc-ecosystem/grpc-gateway/[email protected] | ||
GO111MODULE=on go get golang.org/x/tools/cmd/[email protected] | ||
SRCROOT="$( CDPATH='' cd -- "$(dirname "$0")/../.." && pwd -P )" | ||
|
||
# This script installs all our golang-based codegen utility CLIs necessary for codegen. | ||
# Some dependencies are vendored in go.mod (ones which are actually imported in our codebase). | ||
# Other dependencies are only used as a CLI and do not need vendoring in go.mod (doing so adds | ||
# unecessary dependencies to go.mod). We want to maintain a single source of truth for versioning | ||
# our binaries (either go.mod or go install <pkg>@<version>), so we use two techniques to install | ||
# our CLIs: | ||
# 1. For CLIs which are NOT vendored in go.mod, we can run `go install` with an explicit version | ||
# 2. For packages which we *do* vendor in go.mod, we can run `go install` from the vendor directory | ||
go_mod_install() { | ||
go install -mod=vendor ./vendor/$1 | ||
} | ||
|
||
# All binaries are compiled into the argo-cd/dist directory, which is added to the PATH during codegen | ||
export GOBIN="${SRCROOT}/dist" | ||
mkdir -p $GOBIN | ||
|
||
# protoc-gen-go* is used to generate <service>.pb.go from .proto files | ||
#go_mod_install github.com/golang/protobuf/protoc-gen-go | ||
#go_mod_install github.com/gogo/protobuf/protoc-gen-gogo | ||
go_mod_install github.com/gogo/protobuf/protoc-gen-gogofast | ||
|
||
# protoc-gen-grpc-gateway is used to build <service>.pb.gw.go files from from .proto files | ||
go_mod_install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway | ||
|
||
# # protoc-gen-swagger is used to build swagger.json | ||
go_mod_install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger | ||
|
||
# k8s tools to codegen .proto files, client libraries, and helpers from types.go | ||
go_mod_install k8s.io/code-generator/cmd/go-to-protobuf | ||
go_mod_install k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo | ||
go_mod_install k8s.io/code-generator/cmd/client-gen | ||
go_mod_install k8s.io/code-generator/cmd/deepcopy-gen | ||
go_mod_install k8s.io/code-generator/cmd/defaulter-gen | ||
go_mod_install k8s.io/code-generator/cmd/informer-gen | ||
go_mod_install k8s.io/code-generator/cmd/lister-gen | ||
|
||
# We still install openapi-gen from go.mod since upstream does not utilize release tags | ||
go_mod_install k8s.io/kube-openapi/cmd/openapi-gen | ||
|
||
# controller-gen is run by ./hack/gen-crd-spec to generate the CRDs | ||
go install sigs.k8s.io/controller-tools/cmd/[email protected] | ||
|
||
# swagger cli is used to generate swagger docs | ||
go install github.com/go-swagger/go-swagger/cmd/[email protected] | ||
|
||
# goimports is used to auto-format generated code | ||
go install golang.org/x/tools/cmd/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
set -eux -o pipefail | ||
|
||
KUSTOMIZE_VERSION=4.2.0 "$(dirname $0)/../install.sh" helm2-linux jq-linux kustomize-linux protoc-linux swagger-linux | ||
KUSTOMIZE_VERSION=4.2.0 "$(dirname $0)/../install.sh" helm2-linux jq-linux kustomize-linux protoc-linux |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,28 @@ | ||
//go:build tools | ||
// +build tools | ||
|
||
package tools | ||
|
||
import ( | ||
// gogo/protobuf is vendored because the generated *.pb.go code imports it. | ||
// Also, we need the gogo/protobuf/gogoproto/gogo.proto file | ||
_ "github.com/gogo/protobuf/protoc-gen-gogofast" | ||
|
||
// grpc-ecosystem/grpc-gateway is vendored because the generated *.pb.gw.go code imports it. | ||
// Also, we need the .proto files under grpc-gateway/third_party/googleapis | ||
_ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway" | ||
_ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger" | ||
|
||
// k8s.io/code-generator is vendored to get generate-groups.sh, and k8s codegen utilities | ||
_ "k8s.io/code-generator" | ||
_ "k8s.io/code-generator/cmd/client-gen" | ||
_ "k8s.io/code-generator/cmd/deepcopy-gen" | ||
_ "k8s.io/code-generator/cmd/defaulter-gen" | ||
_ "k8s.io/code-generator/cmd/informer-gen" | ||
_ "k8s.io/code-generator/cmd/lister-gen" | ||
_ "k8s.io/code-generator/cmd/go-to-protobuf" | ||
_ "k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo" | ||
_ "k8s.io/code-generator/pkg/util" | ||
_ "k8s.io/code-generator/third_party/forked/golang/reflect" | ||
_ "k8s.io/code-generator/cmd/informer-gen" | ||
_ "k8s.io/code-generator/cmd/lister-gen" | ||
|
||
// openapi-gen is vendored because upstream does not have tagged releases | ||
_ "k8s.io/kube-openapi/cmd/openapi-gen" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters