[JIRA] (JENKINS-39287) Ability to select from existing credentials list at runtime

11 views
Skip to first unread message

direland@ea.com (JIRA)

unread,
Oct 26, 2016, 6:45:06 PM10/26/16
to jenkinsc...@googlegroups.com
Daniel Ireland created an issue
 
Jenkins / New Feature JENKINS-39287
Ability to select from existing credentials list at runtime
Issue Type: New Feature New Feature
Assignee: Unassigned
Components: p4-plugin
Created: 2016/Oct/26 10:44 PM
Priority: Major Major
Reporter: Daniel Ireland

This was discussed with Paul Allen at the Jenkins World Conference.

The request is to be able to dynamically select between the sets of stored credentials for the instance at the time a job is about to sync from Perforce, rather than having the credentials hardcoded for the job. The credential could perhaps be identified using user/server combinations, as we currently see in the dropdown in the UI. Other identification means would be fine as well.

This is important as it's common for us to have parent jobs which trigger child jobs which use different perforce credentials. Having many many jobs differing only in hardcoded credentials becomes a lot of overhead.

As discussed, we understand the impact this has on the job's representation of CL and changes from last run.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

kwirth@perforce.com (JIRA)

unread,
Jan 18, 2017, 9:42:03 AM1/18/17
to jenkinsc...@googlegroups.com
Karl Wirth started work on New Feature JENKINS-39287
 
Change By: Karl Wirth
Status: Open In Progress

kwirth@perforce.com (JIRA)

unread,
Jan 18, 2017, 9:44:01 AM1/18/17
to jenkinsc...@googlegroups.com
Karl Wirth commented on New Feature JENKINS-39287
 
Re: Ability to select from existing credentials list at runtime

Example usage case:
"Supply a variable to the job that picks the credential to be used".

Note: Stretch Goal - Be able to create credentials on the fly by supplying P4USER,P4PORT and password.

pallen@perforce.com (JIRA)

unread,
Dec 20, 2018, 10:07:02 AM12/20/18
to jenkinsc...@googlegroups.com
Paul Allen closed an issue as Done
 

Closing old issues:

Suggest using the credential in a Jenkinsfile.  Please feel free to reopen if you need an alternative.

Change By: Paul Allen
Status: In Progress Closed
Assignee: Paul Allen
Resolution: Done
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

drew.waranis@sonos.com (JIRA)

unread,
Nov 22, 2019, 3:27:03 PM11/22/19
to jenkinsc...@googlegroups.com
Drew Waranis reopened an issue
 

Howdy,

My team needs this functionality in order to connect our new fleet of build nodes to their co-located P4 replica. Sadly, this regression from the old Perforce Plugin for Jenkins is blocking this effort.

I think the easiest solution would be to make it so that setting the Perforce Credentials field to - none -  causes the plugin to fallback to using the P4PORT, P4SERVER, and P4TRUST environment variables set on the node.

Change By: Drew Waranis
Resolution: Done
Status: Closed Reopened
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

drew.waranis@sonos.com (JIRA)

unread,
Nov 22, 2019, 3:29:03 PM11/22/19
to jenkinsc...@googlegroups.com

kwirth@perforce.com (JIRA)

unread,
Nov 25, 2019, 7:12:03 AM11/25/19
to jenkinsc...@googlegroups.com
 
Re: Ability to select from existing credentials list at runtime

Potential workaround - this article suggests credentials can be built on the fly:

https://support.cloudbees.com/hc/en-us/articles/217708168-create-credentials-from-groovy

 

Alternative workaround: If the slave already contains P4PORT, P4SERVER and P4TRUST, could it have a new variable created called P4_CREDENTIAL that could be used in the script?

kwirth@perforce.com (JIRA)

unread,
Nov 25, 2019, 9:30:03 AM11/25/19
to jenkinsc...@googlegroups.com
Karl Wirth assigned an issue to Karl Wirth
 
Change By: Karl Wirth
Assignee: Paul Allen Karl Wirth

drew.waranis@sonos.com (JIRA)

unread,
Dec 3, 2019, 11:36:15 AM12/3/19
to jenkinsc...@googlegroups.com
Drew Waranis commented on New Feature JENKINS-39287
 
Re: Ability to select from existing credentials list at runtime

Unfortunately, therein lies the rub:

We already have the Jenkins Perforce Credentials created and can pick between them at DSL job generation time, but now we have a set of jobs that can use either of two Jenkins P4 Credentials at job runtime based on the location of the build node running them.

So we need either:

  • The likely simpler way is to have an option for the P4 Plugin use the P4PORT, P4SERVER, and P4TRUST variables set in the job runner's Jenkins Node Properties.
  • Or, a more complicated option is the ability to map Jenkins Node Labels to Jenkins P4 Credentials and then be able to pass that mapping to the P4 Plugin instead of a Jenkins P4 Credential.

Thank you!

pallen@perforce.com (JIRA)

unread,
Dec 5, 2019, 10:44:06 AM12/5/19
to jenkinsc...@googlegroups.com

There is no benefit for implicit checkout; however if you set `options { skipDefaultCheckout() }` then for subsequent checkout steps you could change the credential.  You would need your own logic to look up the credential or specify them with the agent/label. 

 

Reply all
Reply to author
Forward
0 new messages