Skip to content

Commit

Permalink
BOT: run 'make upgrade-klone' and 'make generate'
Browse files Browse the repository at this point in the history
Signed-off-by: cert-manager-bot <cert-manager-bot@users.noreply.github.com>
  • Loading branch information
cert-manager-bot committed May 22, 2024
1 parent 3095b5f commit 54ff122
Show file tree
Hide file tree
Showing 13 changed files with 520 additions and 384 deletions.
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ FORCE:

noop: # do nothing

# Set empty value for MAKECMDGOALS to prevent the "warning: undefined variable 'MAKECMDGOALS'"
# warning from happening when running make without arguments
MAKECMDGOALS ?=

##################################
# Host OS and architecture setup #
##################################
Expand All @@ -56,8 +60,10 @@ noop: # do nothing
# binary may not be available in the PATH yet when the Makefiles are
# evaluated. HOST_OS and HOST_ARCH only support Linux, *BSD and macOS (M1
# and Intel).
HOST_OS ?= $(shell uname -s | tr A-Z a-z)
HOST_ARCH ?= $(shell uname -m)
host_os := $(shell uname -s | tr A-Z a-z)
host_arch := $(shell uname -m)
HOST_OS ?= $(host_os)
HOST_ARCH ?= $(host_arch)

ifeq (x86_64, $(HOST_ARCH))
HOST_ARCH = amd64
Expand All @@ -70,7 +76,8 @@ endif
# Git and versioning information #
##################################

VERSION ?= $(shell git describe --tags --always --match='v*' --abbrev=14 --dirty)
git_version := $(shell git describe --tags --always --match='v*' --abbrev=14 --dirty)
VERSION ?= $(git_version)
IS_PRERELEASE := $(shell git describe --tags --always --match='v*' --abbrev=0 | grep -q '-' && echo true || echo false)
GITCOMMIT := $(shell git rev-parse HEAD)
GITEPOCH := $(shell git show -s --format=%ct HEAD)
Expand Down
1 change: 1 addition & 0 deletions OWNERS_ALIASES
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ aliases:
- irbekrm
- sgtcodfish
- inteon
- thatsmrtalbot
12 changes: 6 additions & 6 deletions klone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@ targets:
- folder_name: boilerplate
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: e9363accaaee20a995bbf8f1c9cba2ea77da8935
repo_hash: 8fbdf9eb949b8712e3017fb8242a7f406633c312
repo_path: modules/boilerplate
- folder_name: generate-verify
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: e9363accaaee20a995bbf8f1c9cba2ea77da8935
repo_hash: 8fbdf9eb949b8712e3017fb8242a7f406633c312
repo_path: modules/generate-verify
- folder_name: help
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: e9363accaaee20a995bbf8f1c9cba2ea77da8935
repo_hash: 8fbdf9eb949b8712e3017fb8242a7f406633c312
repo_path: modules/help
- folder_name: klone
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: e9363accaaee20a995bbf8f1c9cba2ea77da8935
repo_hash: 8fbdf9eb949b8712e3017fb8242a7f406633c312
repo_path: modules/klone
- folder_name: repository-base
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: e9363accaaee20a995bbf8f1c9cba2ea77da8935
repo_hash: 8fbdf9eb949b8712e3017fb8242a7f406633c312
repo_path: modules/repository-base
- folder_name: tools
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: e9363accaaee20a995bbf8f1c9cba2ea77da8935
repo_hash: 8fbdf9eb949b8712e3017fb8242a7f406633c312
repo_path: modules/tools
1 change: 1 addition & 0 deletions make/_shared/generate-verify/00_mod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
# limitations under the License.

shared_generate_targets ?=
shared_generate_targets_dirty ?=
shared_verify_targets ?=
shared_verify_targets_dirty ?=
12 changes: 9 additions & 3 deletions make/_shared/generate-verify/02_mod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,24 @@
## Generate all generate targets.
## @category [shared] Generate/ Verify
generate: $$(shared_generate_targets)
@echo "The following targets cannot be run simultaniously with each other or other generate scripts:"
$(foreach TARGET,$(shared_generate_targets_dirty), $(MAKE) $(TARGET))

verify_script := $(dir $(lastword $(MAKEFILE_LIST)))/util/verify.sh

# Run the supplied make target argument in a temporary workspace and diff the results.
verify-%: FORCE
$(verify_script) $(MAKE) -s $*
+$(verify_script) $(MAKE) $*

verify_generated_targets = $(shared_generate_targets:%=verify-%)
verify_generated_targets_dirty = $(shared_generate_targets_dirty:%=verify-%)

verify_targets = $(sort $(verify_generated_targets) $(shared_verify_targets))
verify_targets_dirty = $(sort $(verify_generated_targets_dirty) $(shared_verify_targets_dirty))

.PHONY: verify
## Verify code and generate targets.
## @category [shared] Generate/ Verify
verify: $$(verify_generated_targets) $$(shared_verify_targets)
verify: $$(verify_targets)
@echo "The following targets create temporary files in the current directory, that is why they have to be run last:"
$(MAKE) noop $(shared_verify_targets_dirty)
$(foreach TARGET,$(verify_targets_dirty), $(MAKE) $(TARGET))
2 changes: 1 addition & 1 deletion make/_shared/generate-verify/util/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ cleanup() {
}
trap "cleanup" EXIT SIGINT

cp -a "${projectdir}/." "${tmp}"
rsync -aEq "${projectdir}/." "${tmp}" --exclude "_bin/"
pushd "${tmp}" >/dev/null

"$@"
Expand Down
4 changes: 3 additions & 1 deletion make/_shared/help/help.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -eu -o pipefail
set -o errexit
set -o nounset
set -o pipefail

## 1. Build set of extracted line items

Expand Down
13 changes: 10 additions & 3 deletions make/_shared/repository-base/base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ FORCE:

noop: # do nothing

# Set empty value for MAKECMDGOALS to prevent the "warning: undefined variable 'MAKECMDGOALS'"
# warning from happening when running make without arguments
MAKECMDGOALS ?=

##################################
# Host OS and architecture setup #
##################################
Expand All @@ -56,8 +60,10 @@ noop: # do nothing
# binary may not be available in the PATH yet when the Makefiles are
# evaluated. HOST_OS and HOST_ARCH only support Linux, *BSD and macOS (M1
# and Intel).
HOST_OS ?= $(shell uname -s | tr A-Z a-z)
HOST_ARCH ?= $(shell uname -m)
host_os := $(shell uname -s | tr A-Z a-z)
host_arch := $(shell uname -m)
HOST_OS ?= $(host_os)
HOST_ARCH ?= $(host_arch)

ifeq (x86_64, $(HOST_ARCH))
HOST_ARCH = amd64
Expand All @@ -70,7 +76,8 @@ endif
# Git and versioning information #
##################################

VERSION ?= $(shell git describe --tags --always --match='v*' --abbrev=14 --dirty)
git_version := $(shell git describe --tags --always --match='v*' --abbrev=14 --dirty)
VERSION ?= $(git_version)
IS_PRERELEASE := $(shell git describe --tags --always --match='v*' --abbrev=0 | grep -q '-' && echo true || echo false)
GITCOMMIT := $(shell git rev-parse HEAD)
GITEPOCH := $(shell git show -s --format=%ct HEAD)
Expand Down
1 change: 1 addition & 0 deletions make/_shared/repository-base/base/OWNERS_ALIASES
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ aliases:
- irbekrm
- sgtcodfish
- inteon
- thatsmrtalbot

0 comments on commit 54ff122

Please sign in to comment.