Skip to content

GPG signing is not working due to missing `gpg-agent`

Describe the bug

GPG signing is not working due to missing gpg-agent

Expected behavior

GPG signing to work

Actual behavior

GPG signing configuration (function configure_commit_signing) is failing without real information

Logs and/or screenshots

https://gitlab.com/Orange-OpenSource/k8s-tz/tools/kube-score-lint/-/jobs/7937027124

$ maybe_install_yq
[INFO] yq not found in cache: download
[INFO] Download latest yq version: https://github.com/mikefarah/yq/releases/download/v4.44.3/yq_linux_amd64.tar.gz
Follow redirect (1): https://objects.githubusercontent.com/github-production-release-asset-2e65be/43225113/1bc62bd7-9e98-404e-a505-44ad12ed4fbb?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=[MASKED]&X-Amz-Date=20240927T101321Z&X-Amz-Expires=300&X-Amz-Signature=[MASKED]&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dyq_linux_amd64.tar.gz&response-content-type=application%2Foctet-stream
Download complete
./yq_linux_amd64
yq.1
install-man-page.sh
$ cd "${SEMREL_CONFIG_DIR}"
$ prepare_semantic_release
[INFO] semantic release configuration file not found, generating default .releaserc
debug: false
tagFormat: '${version}'
plugins: 
  - - '@semantic-release/commit-analyzer'
    - preset: 'angular'
  - - '@semantic-release/release-notes-generator'
    - preset: 'angular'
  - '@semantic-release/gitlab'
  - - '@semantic-release/git'
branches:
  - 'main'
$ install_semantic_release_plugins
[INFO] installing required plugins
added 461 packages in 18s
106 packages are looking for funding
  run `npm fund` for details
added 5 packages in 680ms
$ configure_commit_signing
[INFO] Setting commit signing up.
[INFO] creating GPG base configuration
gpg: directory '/root/.gnupg' created
gpg: keybox '/root/.gnupg/pubring.kbx' created
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: Total number processed: 1
gpg:       secret keys read: 1
Saving cache for failed job 00:03
Creating cache main-SEMREL-1-protected...
/builds/Orange-OpenSource/k8s-tz/tools/kube-score-lint/.npm: found 2836 matching artifact files and directories 
/builds/Orange-OpenSource/k8s-tz/tools/kube-score-lint/.cache: found 2 matching artifact files and directories 
No URL provided, cache will not be uploaded to shared cache server. Cache will be stored only locally. 
Created cache
Cleaning up project directory and file based variables 00:01
ERROR: Job failed: command terminated with exit code 1

Context & Configuration

Link to a project, pipeline or job facing the bug: (please provide one if possible)

The issue was reproduced using:

  • Version of the template: (type in the version)
  • GitLab server(s): (Was it gitlab.com? A self-managed server? Which version? CE / EE? Which license?)
  • GitLab runner(s): (type in any relevant information about the GitLab runner(s) you used)

Here is the .gitlab-ci.yml file:

# Add your .gitlab-ci.yml here, if applicable and useful.

(If useful, list configured GitLab CI project and/or group variables.)

Configured GitLab CI project or group variables:

  • VARIABLE_1
  • VARIABLE_2
  • ...

after digging, I found installing gpg-agent solves the issue