Merge pull request #6658 from dokku/go-mod-readonly

Execute go get/build with mod in readonly mode
This commit is contained in:
Jose Diaz-Gonzalez
2024-03-06 03:35:27 -05:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -28,10 +28,10 @@ clean:
find . -xtype l -delete find . -xtype l -delete
commands: **/**/commands.go commands: **/**/commands.go
GOARCH=$(GOARCH) go build -ldflags="-s -w" $(GO_ARGS) -o commands src/commands/commands.go GOARCH=$(GOARCH) go build -mod=readonly -ldflags="-s -w" $(GO_ARGS) -o commands src/commands/commands.go
subcommands: subcommands:
GOARCH=$(GOARCH) go build -ldflags="-s -w" $(GO_ARGS) -o subcommands/subcommands src/subcommands/subcommands.go GOARCH=$(GOARCH) go build -mod=readonly -ldflags="-s -w" $(GO_ARGS) -o subcommands/subcommands src/subcommands/subcommands.go
$(MAKE) $(SUBCOMMANDS) $(MAKE) $(SUBCOMMANDS)
subcommands/%: subcommands/%:
@@ -41,7 +41,7 @@ src-clean:
rm -rf .gitignore src vendor Makefile *.go glide.* go.sum go.mod rm -rf .gitignore src vendor Makefile *.go glide.* go.sum go.mod
triggers: triggers:
GOARCH=$(GOARCH) go build -ldflags="-s -w" $(GO_ARGS) -o triggers src/triggers/triggers.go GOARCH=$(GOARCH) go build -mod=readonly -ldflags="-s -w" $(GO_ARGS) -o triggers src/triggers/triggers.go
$(MAKE) $(TRIGGERS) $(MAKE) $(TRIGGERS)
triggers/%: triggers/%:

View File

@@ -182,7 +182,7 @@ go-test-plugin:
-v $$PWD:$(GO_REPO_ROOT) \ -v $$PWD:$(GO_REPO_ROOT) \
-w $(GO_REPO_ROOT) \ -w $(GO_REPO_ROOT) \
$(BUILD_IMAGE) \ $(BUILD_IMAGE) \
bash -c "cd plugins/$(PLUGIN_NAME) && go get github.com/onsi/gomega && go test -v -p 1 -race " || exit $$? bash -c "cd plugins/$(PLUGIN_NAME) && go get github.com/onsi/gomega && go test -v -p 1 -race -mod=readonly " || exit $$?
unit-tests: go-tests unit-tests: go-tests
@echo running bats unit tests... @echo running bats unit tests...