From aa7f1a9955d84fd1982da6baa9c1f67cd55a5026 Mon Sep 17 00:00:00 2001 From: Tom Ruff <111608666+WuffusXR@users.noreply.github.com> Date: Sat, 5 Oct 2024 12:56:01 +0300 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 25a79d0..60f8ecc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -57,12 +57,9 @@ pipeline { } stage('Clean Old Container') { steps { - try { + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { 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." + sh 'docker rm otomai' } } }