From 6bf57b7d3fb2b035ca1d0f7b442459635c02c040 Mon Sep 17 00:00:00 2001 From: Tom Ruff Date: Mon, 24 Feb 2025 14:53:51 +0200 Subject: [PATCH] Update Jenkinsfile-prod --- Jenkinsfile-prod | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile-prod b/Jenkinsfile-prod index bb99871..8cc2a90 100644 --- a/Jenkinsfile-prod +++ b/Jenkinsfile-prod @@ -13,6 +13,15 @@ pipeline { } } } + stage('Remove Old Image') { + steps { + script { + catchError(buildResult: 'SUCCESS', message: 'Image doesn\'t exist, skipping...', stageResult: 'ABORTED') { + sh 'docker rmi git.ruff.co.il/amai.ig/otomai:latest' + } + } + } + } stage('Run new container in Production') { steps { script { @@ -28,4 +37,4 @@ pipeline { } } } -} \ No newline at end of file +}