Hello,
I have a Jenkins Pipeline that has been using a Global Perforce Password Credential to perform several P4 commands. Up till now, I need to use and extract the user and password from this credential, which has been straightforward enough:
environment {
P4_CREDS = credentials('jenkins-p4-creds')
}
stages{
stage("Process Perforce Workspace"){
steps {
script {
bat("MyP4Cmd.bat ${P4_CREDS_USR} ${P4_CREDS_PSW}")
}
}
}
}
Recently, though, I find myself needing the Perforce server port as well (the field "P4Port"). Given a known P4 credential, how do I obtain the server port from it in the Pipeline?
Thank you and stay well,
Ingrid