Is it possible to get a shared library to retune a docker run command?
I have the following,
scr/docker_run.groovy
def ubuntu() {
echo "docker run --rm " +
'--env APP_PATH="`pwd`" ' +
'--env RELEASE=true ' +
"-v \"`pwd`:`pwd`\" " +
"-v /var/run/docker.sock:/var/run/docker.sock " +
"ubuntu"
}
Jenkinsfile
@Library('pipeline-library-demo') _
pipeline {
agent {
node {
label params.SLAVE
}
}
parameters {
string(name: 'SLAVE', defaultValue: 'so_slave')
}
stages {
stage('ubuntu') {
steps {
script {
sh docker_run.ubuntu ls -lah
}
}
}
}
}
I have tried different things inside the groovy file, such as echo, sh, call, all returning errors.
Any help would be great