Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

gpg sign git commit in gitlab ci

    - |
      mkdir -p ~/.gnupg/
      echo use-agent >> ~/.gnupg/gpg.conf
      echo pinentry-mode loopback >> ~/.gnupg/gpg.conf
    - |
      echo default-cache-ttl 300 >> ~/.gnupg/gpg-agent.conf
      echo max-cache-ttl 600 >> ~/.gnupg/gpg-agent.conf
    - gpg --import --no-tty --passphrase "$GPG_PASSPHRASE" --batch --yes <(echo "$GPG_PRIVATE_KEY" | tr -d '
')
    - git config --global user.signingkey $GPG_KEY_ID
    - git config --global commit.gpgsign true
    - git config --global gpg.program gpg2
 
PREVIOUS NEXT
Tagged: #gpg #sign #git #commit #gitlab #ci
ADD COMMENT
Topic
Name
2+1 =