Compare commits

..

No commits in common. "07472b3a540ed1794cc69b71d3f444c628557d59" and "6ce35caa5f14a98a3a1f0f6c672f0eb067ec72b9" have entirely different histories.

View File

@ -24,17 +24,10 @@ VERSION ?= $(shell git describe --tags --always --dirty)
# This version-strategy uses a manual value to set the version string # This version-strategy uses a manual value to set the version string
#VERSION ?= 1.2.3 #VERSION ?= 1.2.3
# Podman rootless needs 777. Otherwise should be 755
BINDIRMODE ?= 777
### ###
### These variables should not need tweaking. ### These variables should not need tweaking.
### ###
# So /bin/sh/ sources file at $ENV
SHELL := sh
.SHELLFLAGS := -ic
SRC_DIRS := cmd pkg # directories which hold app source (not vendored) SRC_DIRS := cmd pkg # directories which hold app source (not vendored)
# Windows not working atm # Windows not working atm
@ -132,8 +125,6 @@ $(STAMPS): go-build
go-build: $(BUILD_DIRS) go-build: $(BUILD_DIRS)
@echo @echo
@echo "building for $(OS)/$(ARCH)" @echo "building for $(OS)/$(ARCH)"
@mkdir -p "$$(pwd)/.go/bin/$(OS)_$(ARCH)"
@chmod $(BINDIRMODE) "$$(pwd)/.go/bin/$(OS)_$(ARCH)"
@docker run \ @docker run \
-i \ -i \
--rm \ --rm \
@ -209,16 +200,14 @@ push: $(CONTAINER_DOTFILES)
# TODO: Upstream was using manifest-tool and gcloud commands. Needs update # TODO: Upstream was using manifest-tool and gcloud commands. Needs update
manifest-list: # @HELP builds a manifest list of containers for all platforms manifest-list: # @HELP builds a manifest list of containers for all platforms
manifest-list: all-container manifest-list: all-push
@for bin in $(BINS); do \ @for bin in $(BINS); do \
docker manifest create $(REGISTRY)/$$bin:$(VERSION); \ platforms=$$(echo $(ALL_PLATFORMS) | sed 's/ /,/g'); \
for platform in $(ALL_PLATFORMS); do \ manifest-tool \
docker manifest add --arch $$(echo $$platform | cut -d/ -f2) \ push from-args \
$(REGISTRY)/$$bin:$(VERSION) \ --platforms "$$platforms" \
$(REGISTRY)/$$bin:$(VERSION)__$$(echo $$platform | sed 's#/#_#g'); \ --template $(REGISTRY)/$$bin:$(VERSION)__OS_ARCH \
done; \ --target $(REGISTRY)/$$bin:$(VERSION); \
docker manifest push --all $(REGISTRY)/$$bin:$(VERSION) \
docker://$(REGISTRY)/$$bin:$(VERSION); \
done done
version: # @HELP outputs the version string version: # @HELP outputs the version string
@ -253,15 +242,7 @@ clean: # @HELP removes built binaries and temporary files
clean: container-clean bin-clean clean: container-clean bin-clean
container-clean: container-clean:
@rm -rf .container-* .dockerfile-*; \ rm -rf .container-* .dockerfile-*
for bin in $(BINS); do \
docker image exists "$(REGISTRY)/$$bin:$(VERSION)" && \
docker image rm "$(REGISTRY)/$$bin:$(VERSION)"; \
for platform in $(ALL_PLATFORMS); do \
docker image exists "$(REGISTRY)/$$bin:$(VERSION)__$$(echo $$platform | sed 's#/#_#g')" && \
docker image rm "$(REGISTRY)/$$bin:$(VERSION)__$$(echo $$platform | sed 's#/#_#g')"; \
done \
done; true
bin-clean: bin-clean:
rm -rf .go bin rm -rf .go bin
@ -280,3 +261,6 @@ help:
BEGIN {FS = ": *# *@HELP"}; \ BEGIN {FS = ": *# *@HELP"}; \
{ printf " %-30s %s\n", $$1, $$2 }; \ { printf " %-30s %s\n", $$1, $$2 }; \
' '
#!/bin/sh
# CGO_ENABLED=0 go build -ldflags="-s -w"