-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removes bingo for go run
#350
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,23 +15,26 @@ | |
# Make sure we pick up any local overrides. | ||
-include .makerc | ||
|
||
# bingo manages go binaries needed for building the project | ||
include .bingo/Variables.mk | ||
goimports := golang.org/x/tools/cmd/[email protected] | ||
golangci_lint := github.com/golangci/golangci-lint/cmd/[email protected] | ||
goreleaser := github.com/goreleaser/[email protected] | ||
hugo := github.com/gohugoio/[email protected] | ||
licenser := github.com/liamawhite/[email protected] | ||
|
||
##@ Binary distribution | ||
|
||
.PHONY: release | ||
release: $(GORELEASER) | ||
release: | ||
@echo "--- release ---" | ||
@$(GORELEASER) release --rm-dist | ||
@go run $(goreleaser) release --rm-dist | ||
|
||
GOOS := $(shell go env GOOS) | ||
GOARCH := $(shell go env GOARCH) | ||
BIN := dist/func-e_$(GOOS)_$(GOARCH) | ||
bin $(BIN): $(GORELEASER) | ||
bin $(BIN): | ||
@echo "--- bin ---" | ||
# skip post hooks on bin so that e2e tests don't need to have osslsigncode installed | ||
@$(GORELEASER) build --snapshot --single-target --skip-post-hooks --rm-dist | ||
@go run $(goreleaser) build --snapshot --single-target --skip-post-hooks --rm-dist | ||
|
||
# Requires `wixl` from msitools https://wiki.gnome.org/msitools (or `brew install msitools`) | ||
# If Windows, you can download from here https://github.com/wixtoolset/wix3/releases | ||
|
@@ -43,9 +46,9 @@ MSI_VERSION ?= 0.0.1 | |
# Right now, the only arch we support is amd64 because Envoy doesn't yet support arm64 on Windows | ||
# https://github.com/envoyproxy/envoy/issues/17572 | ||
# Once that occurs, we will need to set -arch arm64 and bundle accordingly. | ||
$(WIN_BIN_EXE): $(GORELEASER) | ||
$(WIN_BIN_EXE): | ||
@echo "--- win-bin ---" | ||
@GOOS=windows GOARCH=amd64 $(GORELEASER) build --snapshot --single-target --rm-dist | ||
@GOOS=windows GOARCH=amd64 @go run $(goreleaser) build --snapshot --single-target --rm-dist | ||
|
||
# Default is self-signed while production should be a Digicert signing key | ||
# | ||
|
@@ -91,10 +94,10 @@ endif | |
|
||
##@ Test website | ||
.PHONY: site | ||
site: $(HUGO) | ||
site: | ||
@echo "--- site ---" | ||
@git submodule update | ||
@cd site && $(HUGO) server --disableFastRender -D | ||
@cd site && go run $(hugo) server --disableFastRender -D | ||
|
||
##@ Unit and End-to-End tests | ||
|
||
|
@@ -123,23 +126,23 @@ coverage: | |
@go tool cover -func coverage.txt | ||
|
||
.PHONY: lint | ||
lint: $(GOLANGCI_LINT) $(LICENSER) $(GORELEASER) .golangci.yml .goreleaser.yaml ## Run the linters | ||
lint: .golangci.yml .goreleaser.yaml ## Run the linters | ||
@echo "--- lint ---" | ||
@$(LICENSER) verify -r . | ||
@$(GOLANGCI_LINT) run --timeout 5m --config .golangci.yml ./... | ||
@$(GORELEASER) check -q | ||
@go run $(licenser) verify -r . | ||
@go run $(golangci_lint) run --timeout 5m --config .golangci.yml ./... | ||
@go run $(goreleaser) check -q | ||
|
||
# The goimports tool does not arrange imports in 3 blocks if there are already more than three blocks. | ||
# To avoid that, before running it, we collapse all imports in one block, then run the formatter. | ||
.PHONY: format | ||
format: $(GOIMPORTS) ## Format all Go code | ||
format: ## Format all Go code | ||
@echo "--- format ---" | ||
@$(LICENSER) apply -r "Tetrate" | ||
@go run $(licenser) apply -r "Tetrate" | ||
@find . -type f -name '*.go' | xargs gofmt -s -w | ||
@for f in `find . -name '*.go'`; do \ | ||
awk '/^import \($$/,/^\)$$/{if($$0=="")next}{print}' $$f > /tmp/fmt; \ | ||
mv /tmp/fmt $$f; \ | ||
$(GOIMPORTS) -w -local github.com/tetratelabs/func-e $$f; \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. doing this in a loop is as time consuming as trying to parse wtf ^^ was trying to do |
||
go run $(goimports) -w -local github.com/tetratelabs/func-e $$f; \ | ||
done | ||
|
||
# Enforce go version matches what's in go.mod when running `make check` assuming the following: | ||
|
@@ -167,8 +170,8 @@ check: ## CI blocks merge until this passes. If this fails, run "make check" lo | |
fi | ||
|
||
.PHONY: clean | ||
clean: $(GOLANGCI_LINT) ## Clean all binaries | ||
clean: ## Clean all binaries | ||
@echo "--- $@ ---" | ||
@rm -rf dist coverage.txt | ||
@go clean -testcache | ||
@$(GOLANGCI_LINT) cache clean | ||
@go run $(golangci_lint) cache clean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will sort out the build cache in a different PR as it requires handling Os-specifics!