Unverified Commit 00daf62a authored by Holger Levsen's avatar Holger Levsen
Browse files

reproducible Debian: use sudo -H



Signed-off-by: Holger Levsen's avatarHolger Levsen <holger@layer-acht.org>
parent eea2e1db
...@@ -687,12 +687,12 @@ fi ...@@ -687,12 +687,12 @@ fi
# #
# Create GPG key for jenkins user if they do not already exist (eg. to sign .buildinfo files) # Create GPG key for jenkins user if they do not already exist (eg. to sign .buildinfo files)
# #
if sudo -u jenkins gpg --with-colons --fixed-list-mode --list-secret-keys | cut -d: -f1 | grep -qsFx 'sec' >/dev/null 2>&1 ; then if sudo -H -u jenkins gpg --with-colons --fixed-list-mode --list-secret-keys | cut -d: -f1 | grep -qsFx 'sec' >/dev/null 2>&1 ; then
explain "$(date) - Not generating GPG key as one already exists for jenkins user." explain "$(date) - Not generating GPG key as one already exists for jenkins user."
else else
explain "$(date) - Generating GPG key for jenkins user." explain "$(date) - Generating GPG key for jenkins user."
sudo -u jenkins gpg --no-tty --batch --gen-key <<EOF sudo -H -u jenkins gpg --no-tty --batch --gen-key <<EOF
Key-Type: RSA Key-Type: RSA
Key-Length: 4096 Key-Length: 4096
Key-Usage: sign Key-Usage: sign
...@@ -704,7 +704,7 @@ Expire-Date: 0 ...@@ -704,7 +704,7 @@ Expire-Date: 0
%commit %commit
EOF EOF
GPG_KEY_ID="$(sudo -u jenkins gpg --with-colons --fixed-list-mode --list-secret-keys | grep '^sec' | cut -d: -f5 | tail -n1)" GPG_KEY_ID="$(sudo -H -u jenkins gpg --with-colons --fixed-list-mode --list-secret-keys | grep '^sec' | cut -d: -f5 | tail -n1)"
if [ "$GPG_KEY_ID" = "" ] if [ "$GPG_KEY_ID" = "" ]
then then
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment