For some reason, when I am doing the following in my Jenkinsfile for a declarative pipeline,
script{
withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', credentialsId: "${env.AWS_DEPLOYMENT_CREDENTIALS}"]]){
echo "==================\n\nDeploying.\n\n=================="
String scriptOutput = sh(
script: 'aws apigateway get-rest-api --rest-api-id <some-id>',
returnStdout: true
).trim()
echo "scriptOutput: ${scriptOutput}"
}
}
I am getting:
process apparently never started
(running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)
and the command with sh never runs but the code executes Deploying correctly.
- The durable-task plugin is
1.36. [https://stackoverflow.com/questions/58346984/how-to-fix-process-apparently-never-started-in-error-in-jenkins-pipeline] - When I copy and paste the entire groovy file in script console with
org.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=trueI get:No signature of method: Script1.pipeline() is applicable for argument types: (Script1$_run_closure1) values:
NOTE: the exact same script works with another jenkins master. I am not sure which version/plugin should I look at to resolve the issue.