From 36d8fea3cec6c246ace1352b5da406fe59581e53 Mon Sep 17 00:00:00 2001 From: Tom Ruff <111608666+WuffusXR@users.noreply.github.com> Date: Sat, 5 Oct 2024 12:53:41 +0300 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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') {