Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We could have a step in our workflow to execute an operation that will connect to an external system using the certificate of the property configured on the project. Below is an example of referencing our property in a groovy script, but it would be similar for environment variables or property replacement within files. For accessing the certificate then we would use the code WEB_CERTIFICATE. For accessing the password, then it would be WEB_CERTIFICATE_PASSWORD. Note that if referencing the password like this, it could fail if the actual value of the property during execution is not a Certificate type credential.

...

FLEXDEPLOY Credential Value Functions

For any groovy script that has access to the FLEXDEPLOY variable, there are methods for accessing the plain text values of a given credential id or name.

Method

Description

FLEXDEPLOY.getCredentialSecretTextValueById(credentialId)

Returns the plain text value of the given Credential id. The id must belong to a credential of type Secret Text.

FLEXDEPLOY.getCredentialSecretTextValueByName(credentialName)

Returns the plain text value of the given Credential name. The name must belong to a credential of type Secret Text.

FLEXDEPLOY.getCredentialValueById(credentialId)

Returns an object containing the plain text values depending on the credential type of the provided id.

Secret Text -> CredentialSecretTextValuePojo

SSH Key → CredentialSshKeyValuePojo

Certificate → CredentialCertificateValuePojo

FLEXDEPLOY.getCredentialValueByName(credentialName)

Returns an object containing the plain text values depending on the credential type of the provided name.

Secret Text -> CredentialSecretTextValuePojo

SSH Key → CredentialSshKeyValuePojo

Certificate → CredentialCertificateValuePojo

CredentialSecretTextValuePojo

Method

Description

getSecretText()

Returns the secret text value of this credential.

CredentialSshKeyValuePojo

Method

Description

getSshKey()

Returns the private key value of this credential.

getSshKeyPassphrase()

Returns the passphrase value of this credential.

CredentialCertificateValuePojo

Method

Description

getCertificate()

Returns the certificate value of this credential.

getCertificatePassword()

Returns the password value of this credential.