Skip to content

Commit 0b8e7ca

Browse files
committed
[skip-ci] suppress gpg key output in make target
1 parent ccfa42d commit 0b8e7ca

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Makefile.packaging

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ $(PACKAGES_DIR):
3535
@mkdir -p $(PACKAGES_DIR)/deb && mkdir -p $(PACKAGES_DIR)/rpm && mkdir -p $(PACKAGES_DIR)/apk
3636

3737
.PHONY: package
38-
package: $(PACKAGES_DIR) #### Create final packages for all supported distros
38+
package: gpg-key $(PACKAGES_DIR) #### Create final packages for all supported distros
3939

4040
# Build binaries for all supported architectures
4141
@for arch in $(DEB_ARCHS); do \
@@ -145,7 +145,12 @@ package: $(PACKAGES_DIR) #### Create final packages for all supported distros
145145

146146
.PHONY: gpg-key
147147
gpg-key: ## Generate GPG public key
148-
$$(gpg --import $(NFPM_SIGNING_KEY_FILE)); \
148+
@if [ -z "$(NFPM_SIGNING_KEY_FILE)" ]; then \
149+
echo "NFPM_SIGNING_KEY_FILE is not set. Exiting..."; \
150+
exit 1; \
151+
fi
152+
@echo "Generating GPG public key for package signing...";
153+
@$$(gpg --import $(NFPM_SIGNING_KEY_FILE)); \
149154
keyid=$$(gpg --list-keys NGINX | egrep -A1 "^pub" | egrep -v "^pub" | tr -d '[:space:]'); \
150155
if [ -z "$$keyid" ]; then echo "Error: GPG key not found."; exit 1; fi; \
151156
# Check if the key is expired \

0 commit comments

Comments
 (0)