I am using the Jenkins Pipeline Plugin, but having trouble getting my
docker config credential to do what I need.
using code like:
node('docker-slave') {
withCredentials([[$class: 'UsernamePasswordMultiBinding',
credentialsId: 'NEXUS', usernameVariable: 'NEXUS_USERNAME',
passwordVariable: 'NEXUS_PASSWORD'],
[$class: 'FileBinding', credentialsId: 'DOCKER_REGISTRY', variable:
'DOCKER_CONFIG_PATH']]) {
def dockerConfigPath = "$DOCKER_CONFIG_PATH"
the dockerConfigPath above does not get populated as I'd hope...
The variable DOCKER_CONFIG_PATH passes in the absolute path to the docker
config file. I only need the directory path, NOT the file path.
So if the DOCKER_CONFIG_PATH is something like
/jenkins/tmp/393939kdk/config.json , I need to set the DOCKER_CONFIG
environment variable to /jenkins/tmp/393939kdk/
Given all the security stuff that's built in to the groovy script, I
haven't been able to do this.
My question boils down to this: how do I get access to the variable
DOCKER_CONFIG_PATH that is pulled from the credentials. I need to drop the
filename at the end off the string.
Thanks
phil
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/03da6c39-62c7-4ce6-8a69-840b3f967f91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.