Skip to content

Commit

Permalink
build: Fix clean-up of vendor (argoproj#4363)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Collins <[email protected]>
  • Loading branch information
alexec committed Oct 26, 2020
1 parent f206b83 commit 52520aa
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
export SHELL:=/bin/bash
export SHELLOPTS:=$(if $(SHELLOPTS),$(SHELLOPTS):)pipefail:errexit

# This means we only one shell, and therefore you can use `trap` to clean-up
.ONESHELL:

# https://stackoverflow.com/questions/4122831/disable-make-builtin-rules-and-variables-from-inside-the-make-file
MAKEFLAGS += --no-builtin-rules
.SUFFIXES:
Expand Down Expand Up @@ -112,15 +109,13 @@ PROTO_BINARIES := $(GOPATH)/bin/protoc-gen-gogo $(GOPATH)/bin/protoc-gen-gogofas

# go_install,path
define go_install
trap 'rm -Rf vendor' EXIT
[ -e vendor ] || go mod vendor
go install -mod=vendor ./vendor/$(1)
endef

# protoc,my.proto
define protoc
# protoc $(1)
trap 'rm -Rf vendor' EXIT
[ -e vendor ] || go mod vendor
protoc \
-I /usr/local/include \
Expand Down Expand Up @@ -274,6 +269,7 @@ codegen: \
$(GOPATH)/bin/mockery
# `go generate ./...` takes around 10s, so we only run on specific packages.
go generate ./persist/sqldb ./pkg/apiclient/workflow ./server/auth ./server/auth/sso ./workflow/executor
rm -Rf vendor

$(GOPATH)/bin/mockery:
./hack/recurl.sh dist/mockery.tar.gz https://github.com/vektra/mockery/releases/download/v1.1.1/mockery_1.1.1_$(shell uname -s)_$(shell uname -m).tar.gz
Expand Down Expand Up @@ -311,7 +307,6 @@ $(GOPATH)/bin/goimports:
go get golang.org/x/tools/cmd/[email protected]

pkg/apis/workflow/v1alpha1/generated.proto: $(GOPATH)/bin/go-to-protobuf $(PROTO_BINARIES) $(TYPES)
trap 'rm -Rf vendor' EXIT
[ -e vendor ] || go mod vendor
${GOPATH}/bin/go-to-protobuf \
--go-header-file=./hack/custom-boilerplate.go.txt \
Expand Down

0 comments on commit 52520aa

Please sign in to comment.