-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
80 additions
and
54 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,10 +7,11 @@ else | |
$(warning warning: please customize variables in Makefile.vars) | ||
endif | ||
|
||
|
||
#GOBIN := $(CURDIR)/build/bin | ||
#PATH := $(GOBIN):$(PATH) | ||
GOBIN ?= $(shell go env GOPATH)/bin | ||
GOMAKE ?= github.com/tkrop/[email protected].34 | ||
GOMAKE ?= github.com/tkrop/[email protected].35 | ||
TARGETS := $(shell command -v $(GOBIN)/go-make >/dev/null || \ | ||
make -f config/Makefile.base install >/dev/stderr && \ | ||
$(GOBIN)/go-make targets) | ||
|
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 |
---|---|---|
|
@@ -32,8 +32,10 @@ FILE_REVIVE ?= $(call search-default,revive.toml) | |
FILE_CODACY ?= $(call search-default,.codacy.yaml) | ||
|
||
FILE_CONTAINER ?= Dockerfile | ||
FILE_DELIVERY ?= delivery.yaml | ||
FILE_DELIVERY_REGEX ?= (cdp-runtime\/go-|go-version: \^?)[0-9.]* | ||
|
||
# Setup custom delivery files to be scanned for updating go versions. | ||
DELIVERY := $(strip $(wildcard delivery.yaml) $(wildcard .github/workflows/*.yaml)) | ||
DELIVERY_REGEX ?= (cdp-runtime\/go-|go-version: \^?)[0-9.]* | ||
|
||
REPOSITORY ?= $(shell git remote get-url origin | \ | ||
sed "s/^https:\/\///; s/^git@//; s/.git$$//; s/:/\//") | ||
|
@@ -62,7 +64,7 @@ TOOLS_GO := $(TOOLS_GO) \ | |
github.com/icholy/gomajor \ | ||
github.com/golang/mock/mockgen \ | ||
github.com/tkrop/go-testing/cmd/mock \ | ||
github.com/tkrop/[email protected].34 | ||
github.com/tkrop/[email protected].35 | ||
TOOLS_SH := $(TOOLS_SH) \ | ||
github.com/anchore/syft \ | ||
github.com/anchore/grype | ||
|
@@ -578,7 +580,7 @@ test-go = \ | |
echo -e "\trun 'make update-go $${VERSION}' to adjust the project!"; \ | ||
exit 1; \ | ||
fi; \ | ||
done; | ||
done | ||
|
||
#@ test whether project is using the latest go-version. | ||
test-go:: | ||
|
@@ -587,11 +589,13 @@ test-go:: | |
VERSIONS=$$(grep "^go [0-9.]*$$" go.mod | cut -f2 -d' '); \ | ||
$(call test-go,go.mod) \ | ||
fi; \ | ||
if [ -f "$(FILE_DELIVERY)" ]; then \ | ||
VERSIONS="$$(grep -Eo "$(FILE_DELIVERY_REGEX)" \ | ||
"$(FILE_DELIVERY)" | grep -Eo "[0-9.]*" | sort -u)"; \ | ||
$(call test-go,$(FILE_DELIVERY)) \ | ||
fi; \ | ||
for FILE in $(DELIVERY); do \ | ||
if [ -f "$$(FILE)" ]; then \ | ||
VERSIONS="$$(grep -Eo "$(DELIVERY_REGEX)" "$$(FILE)" | \ | ||
grep -Eo "[0-9.]*" | sort -u)"; \ | ||
$(call test-go,$${FILE}); \ | ||
fi; \ | ||
done; | ||
|
||
# process test arguments. | ||
testargs = \ | ||
|
@@ -1279,9 +1283,11 @@ update-go:: | |
else VERSION="$(RUNARGS)"; fi; \ | ||
echo "info: update golang version to $${VERSION}"; \ | ||
go get go@latest; go mod tidy -go=$${VERSION}; \ | ||
if [ -f $(FILE_DELIVERY) ]; then \ | ||
sed -E -i -e "s/$(FILE_DELIVERY_REGEX)/\1$${VERSION}/" $(FILE_DELIVERY); \ | ||
fi; \ | ||
for FILE in $(DELIVERY); do \ | ||
if [ -f "$${FILE}" ]; then \ | ||
sed -E -i -e "s/$(DELIVERY_REGEX)/\1$${VERSION}/" "$${FILE}"; \ | ||
fi; \ | ||
done; \ | ||
if [ "$(GOVERSION)" != "$${VERSION}" ]; then \ | ||
echo "warning: current compiler is using $(GOVERSION)" >/dev/stderr; \ | ||
fi; \ | ||
|
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 +1 @@ | ||
0.0.34 | ||
0.0.35 |
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ else | |
endif | ||
|
||
GOBIN ?= $(shell go env GOPATH)/bin | ||
GOMAKE ?= github.com/tkrop/[email protected].34 | ||
GOMAKE ?= github.com/tkrop/[email protected].35 | ||
TARGETS := $(shell command -v $(GOBIN)/go-make >/dev/null || \ | ||
go install $(GOMAKE) >/dev/stderr && $(GOBIN)/go-make targets) | ||
|
||
|
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 |
---|---|---|
|
@@ -32,8 +32,10 @@ FILE_REVIVE ?= $(call search-default,revive.toml) | |
FILE_CODACY ?= $(call search-default,.codacy.yaml) | ||
|
||
FILE_CONTAINER ?= Dockerfile | ||
FILE_DELIVERY ?= delivery.yaml | ||
FILE_DELIVERY_REGEX ?= (cdp-runtime\/go-|go-version: \^?)[0-9.]* | ||
|
||
# Setup custom delivery files to be scanned for updating go versions. | ||
DELIVERY := $(strip $(wildcard delivery.yaml) $(wildcard .github/workflows/*.yaml)) | ||
DELIVERY_REGEX ?= (cdp-runtime\/go-|go-version: \^?)[0-9.]* | ||
|
||
REPOSITORY ?= $(shell git remote get-url origin | \ | ||
sed "s/^https:\/\///; s/^git@//; s/.git$$//; s/:/\//") | ||
|
@@ -62,7 +64,7 @@ TOOLS_GO := $(TOOLS_GO) \ | |
github.com/icholy/gomajor \ | ||
github.com/golang/mock/mockgen \ | ||
github.com/tkrop/go-testing/cmd/mock \ | ||
github.com/tkrop/[email protected].34 | ||
github.com/tkrop/[email protected].35 | ||
TOOLS_SH := $(TOOLS_SH) \ | ||
github.com/anchore/syft \ | ||
github.com/anchore/grype | ||
|
@@ -578,7 +580,7 @@ test-go = \ | |
echo -e "\trun 'make update-go $${VERSION}' to adjust the project!"; \ | ||
exit 1; \ | ||
fi; \ | ||
done; | ||
done | ||
|
||
#@ test whether project is using the latest go-version. | ||
test-go:: | ||
|
@@ -587,11 +589,13 @@ test-go:: | |
VERSIONS=$$(grep "^go [0-9.]*$$" go.mod | cut -f2 -d' '); \ | ||
$(call test-go,go.mod) \ | ||
fi; \ | ||
if [ -f "$(FILE_DELIVERY)" ]; then \ | ||
VERSIONS="$$(grep -Eo "$(FILE_DELIVERY_REGEX)" \ | ||
"$(FILE_DELIVERY)" | grep -Eo "[0-9.]*" | sort -u)"; \ | ||
$(call test-go,$(FILE_DELIVERY)) \ | ||
fi; \ | ||
for FILE in $(DELIVERY); do \ | ||
if [ -f "$$(FILE)" ]; then \ | ||
VERSIONS="$$(grep -Eo "$(DELIVERY_REGEX)" "$$(FILE)" | \ | ||
grep -Eo "[0-9.]*" | sort -u)"; \ | ||
$(call test-go,$${FILE}); \ | ||
fi; \ | ||
done; | ||
|
||
# process test arguments. | ||
testargs = \ | ||
|
@@ -1279,9 +1283,11 @@ update-go:: | |
else VERSION="$(RUNARGS)"; fi; \ | ||
echo "info: update golang version to $${VERSION}"; \ | ||
go get go@latest; go mod tidy -go=$${VERSION}; \ | ||
if [ -f $(FILE_DELIVERY) ]; then \ | ||
sed -E -i -e "s/$(FILE_DELIVERY_REGEX)/\1$${VERSION}/" $(FILE_DELIVERY); \ | ||
fi; \ | ||
for FILE in $(DELIVERY); do \ | ||
if [ -f "$${FILE}" ]; then \ | ||
sed -E -i -e "s/$(DELIVERY_REGEX)/\1$${VERSION}/" "$${FILE}"; \ | ||
fi; \ | ||
done; \ | ||
if [ "$(GOVERSION)" != "$${VERSION}" ]; then \ | ||
echo "warning: current compiler is using $(GOVERSION)" >/dev/stderr; \ | ||
fi; \ | ||
|
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