Skip to content

Commit

Permalink
fix: failing to import a gpg key should prevent nsv from running (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
purpleclay authored Jun 6, 2024
1 parent 6bab6e5 commit 6ad3461
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# syntax=docker/dockerfile:1
FROM alpine:3.20

# renovate: datasource=github-tags depName=purpleclay/gpg-import versioning=semver
ENV GPG_IMPORT_VERSION=0.3.2

RUN apk add --no-cache git git-lfs gnupg tini curl
RUN sh -c "$(curl https://raw.githubusercontent.com/purpleclay/gpg-import/main/scripts/install)" -- -v 0.3.2
RUN sh -c "$(curl https://raw.githubusercontent.com/purpleclay/gpg-import/main/scripts/install)" -- -v ${GPG_IMPORT_VERSION}

ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"]
CMD ["--help"]
Expand Down
6 changes: 5 additions & 1 deletion scripts/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/sh

if [ -n "$GPG_PRIVATE_KEY" ]; then
gpg-import
if ! gpg-import; then
echo
echo "failed to import gpg private key. exiting..."
exit 1
fi
echo
fi

Expand Down

0 comments on commit 6ad3461

Please sign in to comment.