Jenkins pipeline if condition not working

I have a Jenkins pipeline that uses an if statement to check if a docker container is running. I run the following command to get the running state: def containerStatus = sh(script: "ssh -o StrictHostKeyChecking=no -l <user> <server> ‘docker container inspect -f ‘{{.State.Status}}’ ${tagName}’", returnStdout: true) I have added echo containerStatus and in the Jenkins… Read More Jenkins pipeline if condition not working