diff --git a/Jenkinsfile b/Jenkinsfile index 90f9f24..25a79d0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -55,11 +55,15 @@ pipeline { } } } - stage('Clean old container') { + stage('Clean Old Container') { steps { - // Shell command to stop and kill the named container - sh 'docker stop otomai' - sh 'docker rm -rf otomai' + try { + sh 'docker stop otomai' + sh 'docker rm -rf otomai' + } catch (err) { + // Ignore the error if the container doesn't exist + echo "Container 'otomai' doesn't exist. Skipping." + } } } stage('Run new container') {