diff options
author | Chris Evich <cevich@redhat.com> | 2019-05-10 19:02:01 -0400 |
---|---|---|
committer | Chris Evich <cevich@redhat.com> | 2019-07-03 16:51:21 -0400 |
commit | 1ef8637ae31fa63f98e5edd32e01b090fd66c832 (patch) | |
tree | bd3f58288c0b0c33611325eacec245310df21880 /Makefile | |
parent | f5593d305f68409cf093ea6b66a9d1f121ec0fd6 (diff) | |
download | podman-1ef8637ae31fa63f98e5edd32e01b090fd66c832.tar.gz podman-1ef8637ae31fa63f98e5edd32e01b090fd66c832.tar.bz2 podman-1ef8637ae31fa63f98e5edd32e01b090fd66c832.zip |
Cirrus: Automate releasing of tested binaries
It's desirable to make archives available of builds containing actual
tested content. While not official distro-releases, these will enable
third-party testing, experimentation, and development for both branches
(e.g. "master") and pull requests (e.g. "pr3106").
* Add a Makefile targets for archiving both regular podman binaries
and the remote-client. Encode release metadata within these
archives so that their exact source can be identified.
* Fix bug with cross-compiling remote clients for the Windows and Darwin
platforms.
* Add unit-testing of cross-compiles for Windows and Darwin platforms.
* A few small CI-script typo-fixes
* Add a script which operates in two modes:
1. Call Makefile targets which produce release archives.
Upload the archive to Cirrus-CI's built-in caching system
using reproducible cache keys.
2. Utilize reproduced cache keys to attempt download of cache
from each tasks. When successful, parse the file's
release metadata, using it to name the archive file. Upload
all recovered archives to a publicly accessible storage bucket
for future reference.
* Update the main testing task to call the script in mode #1 for
all primary platforms.
* Add a new `$SPECIALMODE` task to call the script in mode #1 for
Windows and Darwin targets.
* Add a new 'release' task to the CI system, dependent upon all other
tasks. This new tasks executes the script in mode #2.
* Update CI documentation
Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 29 |
1 files changed, 26 insertions, 3 deletions
@@ -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 \ @@ -250,6 +256,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 |