Keyring in jenkins cli

66 views
Skip to first unread message

Bhargav sai

unread,
Feb 22, 2022, 8:29:37 AM2/22/22
to Jenkins Users
Hi team,

I am working on Jenkins for a few days and a beginner question, I would like to ask. How to input the password to the build. Suppose, I am working on Keyring, and whenever, I set
"keyring set system user", prompts for the password. How can I input the password while the build is going on? Please help me out.

Dirk Heinrichs

unread,
Feb 22, 2022, 8:36:06 AM2/22/22
to jenkins...@googlegroups.com
Am Montag, dem 21.02.2022 um 22:18 -0800 schrieb Bhargav sai:

How to input the password to the build.

Don't know what exactly "keyring" is, but in order to inject credentials into a build, you'd need to add them to Jenkins, first: "Manage Jenkins" -> "Manage credentials". Then, in the job configuration, you cann check "Use secret text(s) or file(s)" to add one or more credentials bindings, which will put your credentials into environment variables for use in the build steps. Jenkins will also ensure that all ocurrences of the username or password are properly masked in the build log.

HTH...

Dirk
-- 
Dirk Heinrichs
Senior Systems Engineer, Delivery Pipeline
OpenText ™ Discovery | Recommind
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Vertretungsberechtigte Geschäftsführer Gordon Davies, Madhu Ranganathan, Christian Waida, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.

Bhargav sai

unread,
Feb 22, 2022, 9:33:54 AM2/22/22
to Jenkins Users
Hi, Thanks for replying. 

Actually, the keyring is a feature in Ubuntu, to store credentials for a particular service or application. What I am trying to achieve here, is, I have integrated the nexus artifact repository in Jenkins to upload the PYthon package(tar.gz) into the nexus repo. While uploading the python package using twine, it's asking for credentials. So, I am gonna store those credentials in Keyring and would like to input that while the job is in process. I'll leave the link below. Please have a look at it and help me out as I am on this task for a long time.


Dirk Heinrichs

unread,
Feb 22, 2022, 9:56:56 AM2/22/22
to jenkins...@googlegroups.com
Am Dienstag, dem 22.02.2022 um 06:33 -0800 schrieb Bhargav sai:

While uploading the python package using twine, it's asking for credentials.

I also don't know Twine, so I checked its documentation. It says:
 
-u USERNAME, --username USERNAME
                        The username to authenticate to the repository
                        (package index) as. (Can also be set via
                        TWINE_USERNAME environment variable.)
  -p PASSWORD, --password PASSWORD
                        The password to authenticate to the repository
                        (package index) with. (Can also be set via
                        TWINE_PASSWORD environment variable.)

So you can use environment variables to provide the credentials, which means you can use the instructions from my previous mail.

Bhargav sai

unread,
Feb 22, 2022, 10:13:18 AM2/22/22
to Jenkins Users
Hi again,

Thanks for referring to the documentation. I have used with environment variables, but I would like to implement it with the keyring method. Any suggestions or I'll look into the above mail you have sent. Thank you again.
Reply all
Reply to author
Forward
0 new messages