package org.jenkinsci.plugins.p4.groovy; import hudson.FilePath; import hudson.model.Run; import hudson.model.TaskListener; import jenkins.security.MasterToSlaveCallable; import org.jenkinsci.plugins.p4.client.ConnectionHelper; import org.jenkinsci.plugins.p4.credentials.P4BaseCredentials; import org.jenkinsci.plugins.p4.credentials.P4InvalidCredentialException; import org.jenkinsci.plugins.p4.workspace.Workspace; import java.io.Serializable; public class GetP4Task extends MasterToSlaveCallable<P4Groovy, InterruptedException> implements Serializable { private static final long serialVersionUID = 1L; private final P4BaseCredentials credential; private final Workspace workspace; private final FilePath buildWorkspace; private final TaskListener listener; public GetP4Task(Run run, String credential, Workspace workspace, FilePath buildWorkspace, TaskListener listener) throws P4InvalidCredentialException { this.workspace = workspace; this.listener = listener; this.buildWorkspace = buildWorkspace; this.credential = ConnectionHelper.findCredential(credential, run); if (this.credential == null) { throw new P4InvalidCredentialException("credential '" + credential + "' not found."); } } @Override public P4Groovy call() throws InterruptedException { P4Groovy p4Groovy = new P4Groovy(credential, listener, workspace, buildWorkspace); return p4Groovy; } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#5 | 26097 | Paul Allen | Mark internal constructors protected. | ||
#4 | 26096 | Paul Allen |
Merge pull request #108 from joel-f-brown/master Credentials handling for Folders when using P4Groovy. Use run to determine the credentials in GetP4Task, then pass the P4BaseCredentials instead of the credentials ID. Now the P4Groovy getConnection() method uses the P4BaseCredentials instead of looking up the credentials from the active Jenkins instance. JENKINS-58745 JENKINS-57314 |
||
#3 | 21821 | Paul Allen |
Merge pull request #40 from s-sutherland/slaveexec P4Groovy execution to run on the slave |
||
#2 | 20418 | Paul Allen | Replace FileCallable and checkRoles with MasterToSlaveCallable. | ||
#1 | 20308 | Paul Allen |
P4Groovy (experimental) Get a P4 object in groovy. Supporting basic functions: ’run’ (to run perforce commands), ‘fetch’ and ‘save’ (to access Perforce specs). |