Skip to content

Commit

Permalink
Merge pull request #11631 from cevich/replace_hack-get_release_info
Browse files Browse the repository at this point in the history
Fix Error, empty output for info: 'VERSION'
  • Loading branch information
openshift-merge-robot authored Sep 21, 2021
2 parents d8d4949 + 34043bd commit cd7b481
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 85 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ release.txt
/test/checkseccomp/checkseccomp
/test/copyimg/copyimg
/test/goecho/goecho
/test/version/version
/test/testvol/testvol
.vscode*
tags
Expand Down
33 changes: 18 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,9 @@ LIBSECCOMP_COMMIT := v2.3.3
# caller may override in special circumstances if needed.
GINKGOTIMEOUT ?= -timeout=90m

RELEASE_VERSION ?= $(shell hack/get_release_info.sh VERSION)
RELEASE_NUMBER ?= $(shell hack/get_release_info.sh NUMBER|sed -e 's/^v\(.*\)/\1/')
RELEASE_DIST ?= $(shell hack/get_release_info.sh DIST)
RELEASE_DIST_VER ?= $(shell hack/get_release_info.sh DIST_VER)
RELEASE_ARCH ?= $(shell hack/get_release_info.sh ARCH)
RELEASE_BASENAME := $(shell hack/get_release_info.sh BASENAME)
# Conditional required to produce empty-output if binary not built yet.
RELEASE_VERSION = $(shell if test -x test/version/version; then test/version/version; fi)
RELEASE_NUMBER = $(shell echo "$(RELEASE_VERSION)" | sed -e 's/^v\(.*\)/\1/')

# If non-empty, logs all output from server during remote system testing
PODMAN_SERVER_LOG ?=
Expand Down Expand Up @@ -256,6 +253,9 @@ volume-plugin-test-img:
test/goecho/goecho: .gopathok $(wildcard test/goecho/*.go)
$(GO) build $(BUILDFLAGS) -ldflags '$(LDFLAGS_PODMAN)' -o $@ ./test/goecho

test/version/version: .gopathok version/version.go
$(GO) build -o $@ ./test/version/

.PHONY: codespell
codespell:
codespell -S bin,vendor,.git,go.sum,.cirrus.yml,"RELEASE_NOTES.md,*.xz,*.gz,*.ps1,*.tar,*.tgz,bin2img,*ico,*.png,*.1,*.5,copyimg,*.orig,apidoc.go" -L uint,iff,od,seeked,splitted,marge,ERRO,hist,ether -w
Expand Down Expand Up @@ -491,7 +491,7 @@ run-docker-py-tests:
-rm test/__init__.py

.PHONY: localunit
localunit: test/goecho/goecho
localunit: test/goecho/goecho test/version/version
rm -rf ${COVERAGE_PATH} && mkdir -p ${COVERAGE_PATH}
$(GOBIN)/ginkgo \
-r \
Expand Down Expand Up @@ -581,7 +581,8 @@ system.test-binary: .install.ginkgo
$(GO) test -c ./test/system

.PHONY: test-binaries
test-binaries: test/checkseccomp/checkseccomp test/goecho/goecho install.catatonit
test-binaries: test/checkseccomp/checkseccomp test/goecho/goecho install.catatonit test/version/version
@echo "Canonical source version: $(call err_if_empty,RELEASE_VERSION)"

.PHONY: tests-included
tests-included:
Expand All @@ -601,18 +602,18 @@ tests-expect-exit:
### Release/Packaging targets
###

podman-release.tar.gz: binaries docs ## Build all binaries, docs., and installation tree, into a tarball.
podman-release.tar.gz: test/version/version binaries docs ## Build all binaries, docs., and installation tree, into a tarball.
$(eval TMPDIR := $(shell mktemp -d podman_tmp_XXXX))
$(eval SUBDIR := podman-v$(RELEASE_NUMBER))
$(eval SUBDIR := podman-v$(call err_if_empty,RELEASE_NUMBER))
mkdir -p "$(TMPDIR)/$(SUBDIR)"
$(MAKE) install.bin install.man \
$(MAKE) install.bin install.remote install.man \
install.systemd "DESTDIR=$(TMPDIR)/$(SUBDIR)" "PREFIX=/usr"
tar -czvf $@ --xattrs -C "$(TMPDIR)" "./$(SUBDIR)"
-rm -rf "$(TMPDIR)"

podman-remote-release-%.zip: podman-remote-% install-podman-remote-%-docs ## Build podman-remote for GOOS=%, docs., and installation zip.
podman-remote-release-%.zip: test/version/version podman-remote-% install-podman-remote-%-docs ## Build podman-remote for GOOS=%, docs., and installation zip.
$(eval TMPDIR := $(shell mktemp -d podman_tmp_XXXX))
$(eval SUBDIR := podman-$(RELEASE_NUMBER))
$(eval SUBDIR := podman-$(call err_if_empty,RELEASE_NUMBER))
mkdir -p "$(TMPDIR)/$(SUBDIR)"
$(MAKE) \
GOOS=$* \
Expand All @@ -627,14 +628,15 @@ podman-remote-release-%.zip: podman-remote-% install-podman-remote-%-docs ## Bu
-rm -rf "$(TMPDIR)"

.PHONY: podman.msi
podman.msi: podman-v$(RELEASE_NUMBER).msi ## Build podman-remote, package for installation on Windows
podman.msi: test/version/version ## Build podman-remote, package for installation on Windows
$(MAKE) podman-v$(RELEASE_NUMBER).msi
podman-v$(RELEASE_NUMBER).msi: podman-remote-windows install-podman-remote-windows-docs
$(eval DOCFILE := docs/build/remote/windows)
find $(DOCFILE) -print | \
wixl-heat --var var.ManSourceDir --component-group ManFiles \
--directory-ref INSTALLDIR --prefix $(DOCFILE)/ > \
$(DOCFILE)/pages.wsx
wixl -D VERSION=$(RELEASE_VERSION) -D ManSourceDir=$(DOCFILE) \
wixl -D VERSION=$(call err_if_empty,RELEASE_VERSION) -D ManSourceDir=$(DOCFILE) \
-o $@ contrib/msi/podman.wxs $(DOCFILE)/pages.wsx

.PHONY: package
Expand Down Expand Up @@ -832,6 +834,7 @@ clean: ## Clean all make artifacts
build \
test/checkseccomp/checkseccomp \
test/goecho/goecho \
test/version/version \
test/__init__.py \
test/testdata/redis-image \
libpod/container_ffjson.go \
Expand Down
70 changes: 0 additions & 70 deletions hack/get_release_info.sh

This file was deleted.

11 changes: 11 additions & 0 deletions test/version/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package main

import (
"fmt"

"github.com/containers/podman/v3/version"
)

func main() {
fmt.Printf(version.Version.String())
}

0 comments on commit cd7b481

Please sign in to comment.