summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-07-10 15:08:03 +0200
committerGitHub <noreply@github.com>2019-07-10 15:08:03 +0200
commit81e722d08617ee19235bf57de6d86124e6b4574a (patch)
treec0465b57f84ebf23c640fe3ef216b72272da79b4 /Makefile
parentcef566306c9132c610cdd028f7e5035433c12798 (diff)
parent1ef8637ae31fa63f98e5edd32e01b090fd66c832 (diff)
downloadpodman-81e722d08617ee19235bf57de6d86124e6b4574a.tar.gz
podman-81e722d08617ee19235bf57de6d86124e6b4574a.tar.bz2
podman-81e722d08617ee19235bf57de6d86124e6b4574a.zip
Merge pull request #3106 from cevich/cirrus_release
Cirrus: Automate releasing of tested binaries
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 26 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 3f1ddc917..140b2e149 100644
--- a/Makefile
+++ b/Makefile
@@ -69,11 +69,16 @@ LDFLAGS_PODMAN ?= $(LDFLAGS) \
-X $(LIBPOD).etcDir=$(ETCDIR)
#Update to LIBSECCOMP_COMMIT should reflect in Dockerfile too.
LIBSECCOMP_COMMIT := release-2.3
-
# Rarely if ever should integration tests take more than 50min,
# caller may override in special circumstances if needed.
GINKGOTIMEOUT ?= -timeout=90m
+RELEASE_VERSION ?= $(shell git fetch --tags && git describe HEAD 2> /dev/null)
+RELEASE_DIST ?= $(shell ( source /etc/os-release; echo $$ID ))
+RELEASE_DIST_VER ?= $(shell ( source /etc/os-release; echo $$VERSION_ID | cut -d '.' -f 1))
+RELEASE_ARCH ?= $(shell go env GOARCH 2> /dev/null)
+RELEASE_BASENAME := $(shell basename $(PROJECT))
+
# If GOPATH not specified, use one in the local directory
ifeq ($(GOPATH),)
export GOPATH := $(CURDIR)/_output
@@ -148,10 +153,10 @@ podman-remote: .gopathok $(PODMAN_VARLINK_DEPENDENCIES) ## Build with podman on
$(GO) build -gcflags '$(GCFLAGS)' -asmflags '$(ASMFLAGS)' -ldflags '$(LDFLAGS_PODMAN)' -tags "$(BUILDTAGS) remoteclient" -o bin/$@ $(PROJECT)/cmd/podman
podman-remote-darwin: .gopathok $(PODMAN_VARLINK_DEPENDENCIES) ## Build with podman on remote OSX environment
- GOOS=darwin $(GO) build -gcflags '$(GCFLAGS)' -asmflags '$(ASMFLAGS)' -ldflags '$(LDFLAGS_PODMAN)' -tags "remoteclient containers_image_openpgp exclude_graphdriver_devicemapper" -o bin/$@ $(PROJECT)/cmd/podman
+ CGO_ENABLED=0 GOOS=darwin $(GO) build -gcflags '$(GCFLAGS)' -asmflags '$(ASMFLAGS)' -ldflags '$(LDFLAGS_PODMAN)' -tags "remoteclient containers_image_openpgp exclude_graphdriver_devicemapper" -o bin/$@ $(PROJECT)/cmd/podman
podman-remote-windows: .gopathok $(PODMAN_VARLINK_DEPENDENCIES) ## Build with podman for a remote windows environment
- GOOS=windows $(GO) build -gcflags '$(GCFLAGS)' -asmflags '$(ASMFLAGS)' -ldflags '$(LDFLAGS_PODMAN)' -tags "remoteclient containers_image_openpgp exclude_graphdriver_devicemapper" -o bin/$@.exe $(PROJECT)/cmd/podman
+ CGO_ENABLED=0 GOOS=windows $(GO) build -gcflags '$(GCFLAGS)' -asmflags '$(ASMFLAGS)' -ldflags '$(LDFLAGS_PODMAN)' -tags "remoteclient containers_image_openpgp exclude_graphdriver_devicemapper" -o bin/$@.exe $(PROJECT)/cmd/podman
local-cross: $(CROSS_BUILD_TARGETS) ## Cross local compilation
@@ -165,6 +170,7 @@ clean: ## Clean artifacts
rm -rf \
.gopathok \
_output \
+ podman*.zip \
bin \
build \
test/checkseccomp/checkseccomp \
@@ -252,6 +258,23 @@ vagrant-check:
binaries: varlink_generate podman podman-remote ## Build podman
+# Zip archives are supported on all platforms + allows embedding metadata
+podman.zip: binaries docs
+ $(eval TMPDIR := $(shell mktemp -d -p '' $@_XXXX))
+ test -n "$(TMPDIR)"
+ $(MAKE) install "DESTDIR=$(TMPDIR)" "PREFIX=$(TMPDIR)/usr"
+ # Encoded RELEASE_INFO format depended upon by CI tooling
+ # X-RELEASE-INFO format depended upon by CI tooling
+ cd "$(TMPDIR)" && echo \
+ "X-RELEASE-INFO: $(RELEASE_BASENAME) $(RELEASE_VERSION) $(RELEASE_DIST) $(RELEASE_DIST_VER) $(RELEASE_ARCH)" | \
+ zip --recurse-paths --archive-comment "$(CURDIR)/$@" "./"
+ -rm -rf "$(TMPDIR)"
+
+podman-remote-%.zip: podman-remote-%
+ # Don't label darwin/windows cros-compiles with local distribution & version
+ echo "X-RELEASE-INFO: podman-remote $(RELEASE_VERSION) $* cc $(RELEASE_ARCH)" | \
+ zip --archive-comment "$(CURDIR)/$@" ./bin/$<*
+
install.catatonit:
./hack/install_catatonit.sh