forked from open-policy-agent/opa
-
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.
build: Force module mode and using only the vendor directory
There are a handful of scripts that were making `go run` calls without the required environment vars setup force go to use modules and only use the vendor directory. For golang 1.11/12 if OPA was in a path outside of the GOPATH it would switch into module mode automatically (by default) and then try to fetch packages and stuff remotely rather than use the vendor dir. For golang 1.13+ any directory for OPA would (by default) result in trying to use the remote modules rather than vendor dir. Fixes: open-policy-agent#2063 Signed-off-by: Patrick East <[email protected]>
- Loading branch information
1 parent
d4c708c
commit 78eef06
Showing
4 changed files
with
6 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
set -e | ||
|
||
GOOS="" GOARCH="" go run $@ | ||
GOFLAGS=-mod=vendor GO111MODULE=on GOOS="" GOARCH="" go run $@ |
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,3 +1,3 @@ | ||
#!/bin/sh | ||
|
||
GOOS="" GOARCH="" go run ./vendor/golang.org/x/tools/cmd/goimports -local github.com/open-policy-agent/opa $@ | ||
GOFLAGS=-mod=vendor GO111MODULE=on GOOS="" GOARCH="" go run ./vendor/golang.org/x/tools/cmd/goimports -local github.com/open-policy-agent/opa $@ |
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,3 +1,3 @@ | ||
#!/bin/sh | ||
|
||
GOOS="" GOARCH="" go run ./vendor/github.com/mna/pigeon $@ | ||
GOFLAGS=-mod=vendor GO111MODULE=on GOOS="" GOARCH="" go run ./vendor/github.com/mna/pigeon $@ |
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