Hi Jenkins experts,
My first experiment with the Pipeline plugin was to execute a build step inside a Docker container, configured as agent, but I'm unable to use Jenkins' standard variables in my agent configuration.
With the following code I'm trying to mount the current workspace to a specific destination:
stages {
stage('Build') {
agent {
docker {
image 'golang:1.9'
args '-v $WORKSPACE:/go/src/github.com/foo/bar'
}
}
}
This simply doesn't work, the target directory is created by Docker but remains empty, although my workspace does contain the code pulled from my SCM.
Any tips?Thanks!