Skip to content

Commit 70b4c09

Browse files
authored
Makefile: move release signing target variables into target, convert conditional to full bash (#657)
1 parent 97fd973 commit 70b4c09

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

Makefile

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,18 @@ build/operator-sdk-%-x86_64-apple-darwin: GOARGS = GOOS=darwin GOARCH=amd64
4444
build/%:
4545
$(Q)$(GOARGS) go build -o $@ $(BUILD_PATH)
4646

47-
DEFAULT_KEY = $(shell gpgconf --list-options gpg \
48-
| awk -F: '$$1 == "default-key" { gsub(/"/,""); print toupper($$10)}')
49-
GIT_KEY = $(shell git config --get user.signingkey | awk '{ print toupper($$0) }')
5047
build/%.asc:
51-
ifeq ("$(DEFAULT_KEY)","$(GIT_KEY)")
52-
$(Q)gpg --output $@ --detach-sig build/$*
53-
$(Q)gpg --verify $@ build/$*
54-
else
55-
@echo "git and/or gpg are not configured to have default signing key ${DEFAULT_KEY}"
56-
@exit 1
57-
endif
48+
$(Q){ \
49+
default_key=$$(gpgconf --list-options gpg | awk -F: '$$1 == "default-key" { gsub(/"/,""); print toupper($$10)}'); \
50+
git_key=$$(git config --get user.signingkey | awk '{ print toupper($$0) }'); \
51+
if [ "$${default_key}" = "$${git_key}" ]; then \
52+
gpg --output $@ --detach-sig build/$*; \
53+
gpg --verify $@ build/$*; \
54+
else \
55+
echo "git and/or gpg are not configured to have default signing key $${default_key}"; \
56+
exit 1; \
57+
fi; \
58+
}
5859

5960
.PHONY: install release_x86_64 release
6061

0 commit comments

Comments
 (0)