@@ -7,8 +7,9 @@ GEN_PASSWORD=$(shell (/usr/bin/apg -n1 -m32))
77IMAGE_TAG = garm-build
88
99IMAGE_BUILDER =$(shell (which docker || which podman) )
10- USER_ID =$(shell (($(IMAGE_BUILDER ) --version | grep -q podman) && echo "0" || id -u))
11- USER_GROUP =$(shell (($(IMAGE_BUILDER ) --version | grep -q podman) && echo "0" || id -g))
10+ IS_PODMAN =$(shell (($(IMAGE_BUILDER ) --version | grep -q podman) && echo "yes" || echo "no"))
11+ USER_ID =$(if $(filter yes,$(IS_PODMAN ) ) ,0,$(shell id -u) )
12+ USER_GROUP =$(if $(filter yes,$(IS_PODMAN ) ) ,0,$(shell id -g) )
1213ROOTDIR =$(dir $(abspath $(lastword $(MAKEFILE_LIST ) ) ) )
1314GOPATH ?= $(shell go env GOPATH)
1415VERSION ?= $(shell git describe --tags --match='v[0-9]* ' --dirty --always)
@@ -21,6 +22,11 @@ export CREDENTIALS_NAME ?= test-garm-creds
2122export WORKFLOW_FILE_NAME ?= test.yml
2223export GARM_ADMIN_USERNAME ?= admin
2324
25+ ifeq ($(IS_PODMAN ) ,yes)
26+ EXTRA_ARGS := -v /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt
27+ endif
28+
29+
2430.PHONY : help
2531help : # # Display this help.
2632 @awk ' BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST )
@@ -33,7 +39,7 @@ default: build
3339.PHONY : build-static test install-lint-deps lint go-test fmt fmtcheck verify-vendor verify create-release-files release
3440build-static : # # Build garm statically
3541 @echo Building garm
36- $(IMAGE_BUILDER ) build -v /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt --tag $(IMAGE_TAG ) -f Dockerfile.build-static .
42+ $(IMAGE_BUILDER ) build $( EXTRA_ARGS ) --tag $(IMAGE_TAG ) -f Dockerfile.build-static .
3743 mkdir -p build
3844 $(IMAGE_BUILDER ) run --rm -e USER_ID=$(USER_ID ) -e GARM_REF=$(GARM_REF ) -e USER_GROUP=$(USER_GROUP ) -v $(PWD ) /build:/build/output:z $(IMAGE_TAG ) /build-static.sh
3945 @echo Binaries are available in $(PWD ) /build
0 commit comments