The plugin makes use of the Jenkins Credential store, making it easier to manage the Helix Core Server (P4d) connection for multiple Jenkins jobs. P4 Plugin credentials must be added to a Global or User defined domain, using one of the two supported plugin Credentials: Perforce Password Credential or Perforce Ticket Credential.
- Navigate to the Jenkins Credentials page by clicking Credentials in the sidebar menu.
- Add a domain if required.
- Click the (global) link in the Stores scoped by Jenkins table.
- Click Add credentials in the sidebar menu.
- Now complete credential configuration by selecting one of the following credential types:
- Select Perforce Password Credential from the Kind dropdown.
- Select the scope for the credential from the Scope dropdown.
- If you are using Freestyle to configure jobs, the ID field can be left blank. If you are using Pipeline or MultiBranch to configure jobs, enter a unique ID for the credentials in the ID field.
- Optional: Enter a description for the credential in the Description field.
- Enter the server and port number details in the P4Port field. For example: 10.0.0.4:1666 perforce:1666 perforce.domain.com:1666 localhost:1666
- If the Perforce Helix Server is configured for SSL connections, select the SSL connection checkbox and enter the Trust fingerprint in the Trust field. If you have a problem connecting with SSL, see Error using SSL below.
- Enter a valid username in the Username field. The minimum protection level for the jenkins user account is open.
- Enter a valid password in the Password field.
- To check that you have configured the credentials correctly, click Test Connection. The credentials are tested against the Perforce Helix Server and if they are configured correctly Success is displayed.
- Click Save to save the credentials.
Click the browser Back button to go back to the previous page.
The Perforce Ticket Credential supports using a ticket file such as the default P4TICKETS file or a ticket value returned by the command p4 login -p
.
- Select Perforce Ticket Credential from the Kind dropdown.
- Select the scope for the credential from the Scope dropdown.
- If you are using Freestyle to configure jobs the ID field can be left blank. If you are using Pipeline or MultiBranch to configure jobs enter a unique ID for the credentials in the ID field.
- Optional: Enter a description for the credential in the Description field.
- Enter the server and port number details in the P4Port field. For example: 10.0.0.4:1666 perforce:1666 perforce.domain.com:1666 localhost:1666
- If the Perforce Helix Server is configured for SSL connections, select the SSL connection checkbox and enter the Trust fingerprint in the Trust field. If you have a problem connecting with SSL, see Error using SSL below.
- Enter a valid username in the Username field. The minimum protection level for the jenkins user account is open.
- Select one of the following options for the Perforce ticket:
Ticket value: Select the Login with ticket value checkbox and enter a valid session ticket. Use the
p4 login -p
command to print the ticket, add the '-a' flag to enable the ticket to be used from any machine. P4TICKETS file: Select the Use P4TICKETS file checkbox and enter the full path to the Perforce tickets file. Typically /[HOME]/.p4tickets or c:[HOME]\p4tickets.txt. - To check that you have configured the credentials correctly, click Test Connection. The credentials are tested against the Perforce Helix Server and if they are configured correctly Success is displayed.
- Click Save to save the credentials.
Click the browser Back button to go back to the previous page.
Error: Setting up a SSL Credentials connection to a Helix Server (P4D).
Unable to connect: com.perforce.p4java.exception.ConnectionException:
Error occurred during the SSL handshake:
invalid SSL session
Solution: Due to current US export control restrictions for some countries, the standard JDK package only comes with 128 bit encryption level cyphers. In order to use P4Java to connect to an SSL-enabled Helix Server (P4D), those living in eligible countries may download the unlimited strength JCE (Java Cryptography Extension) package and replace the current default cryptography jar files on the build server with the unlimited strength files. The libraries can be downloaded from: http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html Installation instructions can be found in the file 'README.txt' in the JCE download.
Click the browser Back button to go back to the previous page.
Error: Perforce login error part way through a build with an Edge/Commit setup.
Perforce password (P4PASSWD) invalid or unset.
- no such file(s).
ERROR: Unable to update workspace:
com.perforce.p4java.exception.AccessException: Perforce password (P4PASSWD) invalid or unset.
Solution: The following configurables must be set to allow the Edge to forward the login information to the Commit server.
p4 configure set cluster.id=myID
p4 configure set myEdge#rpl.forward.login=1
Click the browser Back button to go back to the previous page.