Skip to content

Commit

Permalink
Upgrade kustomize and use go1.16
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvain Rabot <[email protected]>
  • Loading branch information
sylr committed Mar 2, 2021
1 parent 569700a commit 0fda3c7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ KUSTOMIZE_SRC ?= $(GOPATH)/src/sigs.k8s.io/kustomize/kustomize
KUSTOMIZE_SYLR_REPO ?= https://github.com/sylr/kustomize.git

AGE_YAML_SUPPORT_COMMIT ?= d3cd2ad563ad35a349339e899a8ed39f7e29dc02
KUSTOMIZE_AGE_SUPPORT_COMMIT ?= be09d792963483bf6c5f82aa6b36d522ee963634
KUSTOMIZE_AGE_SUPPORT_COMMIT ?= 8de35139bca2d568069daa089d4896146fba1426

export GOPATH

Expand All @@ -19,32 +19,33 @@ all: make-binaries
make-binaries: age-binaries kustomize-binaries

$(AGE_SRC):
GOPATH=$(GOPATH) $(GO) get -d filippo.io/age/...
# mkdir -p $(shell dirname $(AGE_SRC))
git clone $(AGE_SYLR_REPO) $(AGE_SRC)

age-git-reset:
age-git-reset: $(AGE_SRC)
git -C "$(AGE_SRC)" remote add sylr $(AGE_SYLR_REPO) || true
git -C "$(AGE_SRC)" remote update
git -C "$(AGE_SRC)" rev-parse --verify kustomize-age || git -C "$(AGE_SRC)" checkout -b kustomize-age $(AGE_YAML_SUPPORT_COMMIT)
git -C "$(AGE_SRC)" rev-parse --verify kustomize-age && git -C "$(AGE_SRC)" checkout kustomize-age && git -C "$(AGE_SRC)" reset --hard $(AGE_YAML_SUPPORT_COMMIT)

$(KUSTOMIZE_SRC):
GOPATH=$(GOPATH) $(GO) get -d sigs.k8s.io/kustomize/kustomize/...
# mkdir -p $(shell dirname $(KUSTOMIZE_SRC))
git clone $(KUSTOMIZE_SYLR_REPO) $(shell dirname $(KUSTOMIZE_SRC))

kustomize-git-reset:
git -C "$(KUSTOMIZE_SRC)/.." remote add sylr $(KUSTOMIZE_SYLR_REPO) || true
git -C "$(KUSTOMIZE_SRC)/.." remote update
git -C "$(KUSTOMIZE_SRC)/.." rev-parse --verify kustomize-age || git -C "$(KUSTOMIZE_SRC)/.." checkout -b kustomize-age $(KUSTOMIZE_AGE_SUPPORT_COMMIT)
git -C "$(KUSTOMIZE_SRC)/.." rev-parse --verify kustomize-age && git -C "$(KUSTOMIZE_SRC)/.." checkout kustomize-age && git -C "$(KUSTOMIZE_SRC)/.." reset --hard $(KUSTOMIZE_AGE_SUPPORT_COMMIT)

age-binaries: $(AGE_SRC) age-git-reset
age-binaries: age-git-reset $(AGE_SRC)
cd $(AGE_SRC); \
for platform in $(PLATFORMS); do \
GOOS=$$(cut -d / -f1 <<<$$platform); \
GOARCH=$$(cut -d / -f2 <<<$$platform); \
OUTPUT=$$(basename $$PWD)-$$GOOS-$$GOARCH-$$(git rev-parse --short=8 HEAD); \
test "$$GOOS" == "windows" && OUTPUT=$${OUTPUT}.exe; \
GOOS=$$GOOS GOARCH=$$GOARCH go build -ldflags="-s -w" -trimpath -o $$OUTPUT ./cmd/age; \
upx $$OUTPUT; \
cp $$OUTPUT $(CURDIR)/bin; \
done

Expand All @@ -56,6 +57,5 @@ kustomize-binaries: $(KUSTOMIZE_SRC) kustomize-git-reset
OUTPUT=$$(basename $$PWD)-$$GOOS-$$GOARCH-$$(git rev-parse --short=8 HEAD); \
test "$$GOOS" == "windows" && OUTPUT=$${OUTPUT}.exe; \
GOOS=$$GOOS GOARCH=$$GOARCH go build -ldflags="-s -w" -trimpath -o $$OUTPUT .; \
upx $$OUTPUT; \
cp $$OUTPUT $(CURDIR)/bin; \
done

0 comments on commit 0fda3c7

Please sign in to comment.