Git Product home page Git Product logo

rpmsign-plugin's Introduction

Jenkins RPM Sign Plugin

Build Status

This plugin adds a post-build step to sign rpms using GPG.

Dependencies

This plugin depends on both gpg and expect being installed on the host machine. Make sure your Locale is set to en_US, otherwise the expect script wont work as desired.

Usage

rpmsign-plugin's People

Contributors

daniel-beck-bot avatar denzs avatar elibus avatar georgecodes avatar jimmidyson avatar maclean avatar radeksimko avatar unilama avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rpmsign-plugin's Issues

Don't import secret key

Having the secret key known to Jenkins makes me a little uncomfortable.
Instead I see two ways around it.

  1. Don't require the privateKey in the global configuration. If the privateKey is null, then assume it is imported already (from the command line by someone logged in as the jenkins user).
  2. Declare the privateKey to be hudson.util.Secret (as you do with the passphrase), and do a getPlainText() on it before importing it.

Project status

Is this project still being maintained at all? We have been using it, but are reconsidering since there hasn't been any activity in nearly 3 years.

rpmsign fails on projects or jobs with spaces

If there is a space in the project or job name, such as "package building", then the rpm path includes a space and the rpmsign command return an error complaining it can't find "building/myrpm-1.0-1.el6.noarch.rpm" when it should be signing "/var/lib/jenkins/workspace/MyProject/package building/myrpm-1.0-1.el6.noarch.rpm."

Simplify document about rpm signing with passphrase

Look at the default value of the RPM macro named "__gpg_sign_cmd" in /usr/lib/rpm/macros, or with rpm --eval:

The feature was added in commit: rpm-software-management/rpm@932f14f

In all modern systems with rpm >= 4.14.0-rc1, you should be able to rely on _gpg_sign_cmd_extra_args as upstream feature.

If your __gpg_sign_cmd is defined as:

#==============================================================================
# ---- GPG/PGP/PGP5 signature macros.
#       Macro(s) to hold the arguments passed to GPG/PGP for package
#       signing and verification.
#

%__gpg_sign_cmd                 %{__gpg} \
        gpg --no-verbose --no-armor \
        %{?_gpg_digest_algo:--digest-algo %{_gpg_digest_algo}} \
        --no-secmem-warning \
        %{?_gpg_sign_cmd_extra_args:%{_gpg_sign_cmd_extra_args}} \
        -u "%{_gpg_name}" -sbo %{__signature_filename} %{__plaintext_filename}

Then _gpg_sign_cmd_extra_args is exactly the feature you need. You can do this just by adding this to .rpmmacros:

%_gpg_sign_cmd_extra_args --pinentry-mode loopback

And now you can be sure you are not going to break __gpg_sign_cmd in the future.

Package signing fails when expect timeout is met

On large packages, the plugin will silently fail as the expect timeout of 10 seconds is met:

[RpmSignPlugin] - Running rpm --define "_gpg_name *****************" --verbose --addsign /home/jenkinsbuild/workspace/*********/***.rpm
[****] $ expect -
spawn rpm --define _gpg_name ********* --verbose --addsign /home/jenkinsbuild/workspace/*********/***.rpm
Enter pass phrase: 
Pass phrase is good.
/home/jenkinsbuild/workspace/*********/***.rpm:
[RpmSignPlugin] - Finished signing RPMs ...
[RhnPush] - Starting publishing RPMs ...
[****] $ rhnpush --server=*** -u *** -p *** -c *** /home/jenkinsbuild/workspace/*********/***.rpm
ERROR: /home/jenkinsbuild/workspace/*********/***.rpm: unsigned rpm (use --nosig to force)
[RhnPush] - Failed publishing RPMs ...
Build step '[RhnPush] - Pushes RPMs to Spacewalk or RHN server' marked build as failure

Testing outside the Jenkins environment using a similar expect approach yields the same result. Only after adding a 'set timeout N' with any suitable value before the spawn would fix this. In my case the signing process took around 18 seconds. It would worth adding an option for this in the plugin configuration :). Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.