Compare commits
No commits in common. "07472b3a540ed1794cc69b71d3f444c628557d59" and "6ce35caa5f14a98a3a1f0f6c672f0eb067ec72b9" have entirely different histories.
07472b3a54
...
6ce35caa5f
38
Makefile
38
Makefile
|
@ -24,17 +24,10 @@ VERSION ?= $(shell git describe --tags --always --dirty)
|
|||
# This version-strategy uses a manual value to set the version string
|
||||
#VERSION ?= 1.2.3
|
||||
|
||||
# Podman rootless needs 777. Otherwise should be 755
|
||||
BINDIRMODE ?= 777
|
||||
###
|
||||
### 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)
|
||||
|
||||
# Windows not working atm
|
||||
|
@ -132,8 +125,6 @@ $(STAMPS): go-build
|
|||
go-build: $(BUILD_DIRS)
|
||||
@echo
|
||||
@echo "building for $(OS)/$(ARCH)"
|
||||
@mkdir -p "$$(pwd)/.go/bin/$(OS)_$(ARCH)"
|
||||
@chmod $(BINDIRMODE) "$$(pwd)/.go/bin/$(OS)_$(ARCH)"
|
||||
@docker run \
|
||||
-i \
|
||||
--rm \
|
||||
|
@ -209,16 +200,14 @@ push: $(CONTAINER_DOTFILES)
|
|||
|
||||
# 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: all-container
|
||||
manifest-list: all-push
|
||||
@for bin in $(BINS); do \
|
||||
docker manifest create $(REGISTRY)/$$bin:$(VERSION); \
|
||||
for platform in $(ALL_PLATFORMS); do \
|
||||
docker manifest add --arch $$(echo $$platform | cut -d/ -f2) \
|
||||
$(REGISTRY)/$$bin:$(VERSION) \
|
||||
$(REGISTRY)/$$bin:$(VERSION)__$$(echo $$platform | sed 's#/#_#g'); \
|
||||
done; \
|
||||
docker manifest push --all $(REGISTRY)/$$bin:$(VERSION) \
|
||||
docker://$(REGISTRY)/$$bin:$(VERSION); \
|
||||
platforms=$$(echo $(ALL_PLATFORMS) | sed 's/ /,/g'); \
|
||||
manifest-tool \
|
||||
push from-args \
|
||||
--platforms "$$platforms" \
|
||||
--template $(REGISTRY)/$$bin:$(VERSION)__OS_ARCH \
|
||||
--target $(REGISTRY)/$$bin:$(VERSION); \
|
||||
done
|
||||
|
||||
version: # @HELP outputs the version string
|
||||
|
@ -253,15 +242,7 @@ clean: # @HELP removes built binaries and temporary files
|
|||
clean: container-clean bin-clean
|
||||
|
||||
container-clean:
|
||||
@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
|
||||
rm -rf .container-* .dockerfile-*
|
||||
|
||||
bin-clean:
|
||||
rm -rf .go bin
|
||||
|
@ -280,3 +261,6 @@ help:
|
|||
BEGIN {FS = ": *# *@HELP"}; \
|
||||
{ printf " %-30s %s\n", $$1, $$2 }; \
|
||||
'
|
||||
|
||||
#!/bin/sh
|
||||
# CGO_ENABLED=0 go build -ldflags="-s -w"
|
||||
|
|
Loading…
Reference in New Issue
Block a user