Skip to content

Commit

Permalink
chore: make sure to use correct COMMIT variables in Makefiles
Browse files Browse the repository at this point in the history
Co-authored-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
  • Loading branch information
jakobmoellerdev and hilmarf committed Nov 15, 2024
1 parent b06263a commit 70e1fc8
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ REPO_ROOT := $(shell dirname $(realpath $(l
GITHUBORG ?= open-component-model
OCMREPO ?= ghcr.io/$(GITHUBORG)/ocm
VERSION := $(shell go run api/version/generate/release_generate.go print-rc-version $(CANDIDATE))
COMMIT = $(shell git rev-parse HEAD)
COMMIT = $(shell git rev-parse --verify HEAD)
# if EFFECTIVE_VERSION is not set, set it to VERSION+HEAD
# this is not the same as '?=' because it will also set the value if EFFECTIVE_VERSION is set to an empty string
ifeq ($(EFFECTIVE_VERSION),)
EFFECTIVE_VERSION := $(VERSION)+$(shell git rev-parse HEAD)
EFFECTIVE_VERSION := $(VERSION)+$(COMMIT)
endif
GIT_TREE_STATE := $(shell [ -z "$$(git status --porcelain 2>/dev/null)" ] && echo clean || echo dirty)
COMMIT := $(shell git rev-parse --verify HEAD)
Expand Down
2 changes: 1 addition & 1 deletion components/demoplugin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CTF_TYPE ?= directory

REPO_ROOT := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/../..
VERSION = $(shell go run ../../api/version/generate/release_generate.go print-rc-version $(CANDIDATE))
COMMIT = $(shell git rev-parse HEAD)
COMMIT = $(shell git rev-parse --verify HEAD)
# if EFFECTIVE_VERSION is not set, set it to VERSION+COMMIT
# this is not the same as '?=' because it will also set the value if EFFECTIVE_VERSION is set to an empty string
ifeq ($(EFFECTIVE_VERSION),)
Expand Down
2 changes: 1 addition & 1 deletion components/ecrplugin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CTF_TYPE ?= directory

REPO_ROOT := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/../..
VERSION = $(shell go run ../../api/version/generate/release_generate.go print-rc-version $(CANDIDATE))
COMMIT = $(shell git rev-parse HEAD)
COMMIT = $(shell git rev-parse --verify HEAD)
# if EFFECTIVE_VERSION is not set, set it to VERSION+COMMIT
# this is not the same as '?=' because it will also set the value if EFFECTIVE_VERSION is set to an empty string
ifeq ($(EFFECTIVE_VERSION),)
Expand Down
2 changes: 1 addition & 1 deletion components/helmdemo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ HELMINSTCOMP = $(PROVIDER)/toi/installers/helminstaller

REPO_ROOT := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/../..
VERSION = $(shell go run ../../api/version/generate/release_generate.go print-rc-version $(CANDIDATE))
COMMIT = $(shell git rev-parse HEAD)
COMMIT = $(shell git rev-parse --verify HEAD)
# if EFFECTIVE_VERSION is not set, set it to VERSION-COMMIT
# this is not the same as '?=' because it will also set the value if EFFECTIVE_VERSION is set to an empty string
ifeq ($(EFFECTIVE_VERSION),)
Expand Down
2 changes: 1 addition & 1 deletion components/ocmcli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ CTF_TYPE ?= directory
REPO_ROOT := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))../..
GIT_TREE_STATE = $(shell [ -z "$$(git status --porcelain 2>/dev/null)" ] && echo clean || echo dirty)
VERSION = $(shell go run ../../api/version/generate/release_generate.go print-rc-version $(CANDIDATE))
COMMIT = $(shell git rev-parse HEAD)
COMMIT = $(shell git rev-parse --verify HEAD)
# if EFFECTIVE_VERSION is not set, set it to VERSION+COMMIT
# this is not the same as '?=' because it will also set the value if EFFECTIVE_VERSION is set to an empty string
ifeq ($(EFFECTIVE_VERSION),)
Expand Down
2 changes: 1 addition & 1 deletion components/subchartsdemo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PODINFO_CHART_VERSION = 6.3.5
REPO_ROOT := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/../..
GIT_TREE_STATE = $(shell [ -z "$$(git status --porcelain 2>/dev/null)" ] && echo clean || echo dirty)
VERSION = $(shell go run $(REPO_ROOT)/api/version/generate/release_generate.go print-rc-version $(CANDIDATE))
COMMIT = $(shell git rev-parse HEAD)
COMMIT = $(shell git rev-parse --verify HEAD)
# if EFFECTIVE_VERSION is not set, set it to VERSION-COMMIT
# this is not the same as '?=' because it will also set the value if EFFECTIVE_VERSION is set to an empty string
ifeq ($(EFFECTIVE_VERSION),)
Expand Down
2 changes: 1 addition & 1 deletion examples/make/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ OCI_REPO := ghcr.io/mandelsoft/cnudie

REPO_ROOT := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
VERSION = $(shell cat $(REPO_ROOT)/VERSION)
COMMIT = $(shell git rev-parse HEAD)
COMMIT = $(shell git rev-parse --verify HEAD)
EFFECTIVE_VERSION = $(VERSION)-$(COMMIT)

.PHONY: ctf
Expand Down

0 comments on commit 70e1fc8

Please sign in to comment.