We have freestyle projects configured in Jenkins that run shell scripts as build steps. In some cases, we need access to credentials for third-party services. We solved this by providing credentials like:
USER=theuser
PASS=thepass
in the project environment ( Prepare an environment for the run -> Properties Content)
This works fine, but this is a bad solution because:
- credentials are not stored securely
- they are visible to anyone who has access to the project configuration
- they flow in the Jenkins console.
We studied a little and discovered a promising plugin , but we donβt know how to make the credentials managed by the plugin accessible to our scripts, ideally as environment variables.
How can we access credentials managed by the Jenkins plugin from a script?
source
share