Is there a syntax in a declarative Pipeline to fetch secret file in environment {} section ?
I am aware of the following syntax, but I'm not sure it's the recommended way for a declarative Pipeline.
withCredentials( [file(credentialsId: 'my-secret-file', variable: 'MY_SECRET_FILE')])
{
sh """
ln -s ${env.MY_SECRET_FILE} download/mysecretfile.crt
"""
}
Thanks.