I am trying to convert a script pipeline into a declarative pipeline and work on some of the main (I think) issues.
stage ('Deploy to Docker') { steps { parallel ( "instance1" : { environment { containerId = sh(script: "docker ps --quiet --filter name=${fullDockerImageName}", returnStdout: true).trim() } steps { .... } } ) } }
This throws the following exception:
WorkflowScript: 197: Expected a step @ line 197, column 29. containerId = sh(script: "docker ps --quiet --filter name=${fullDockerImageName} ", returnStdout: true).trim()
Since I am not allowed to assign variables inside the steps {} block, I moved it to the environment {} block, but that also doesn't seem like a trick.
Any idea on how to set these variables?
jenkins jenkins-pipeline
Jasper roel
source share