From 8704cabed37b6f9db7f3a305b177cb96f385b98e Mon Sep 17 00:00:00 2001 From: Ryan Kegel Date: Wed, 10 Dec 2025 15:23:15 -0500 Subject: [PATCH] added jenkins deployment --- Jenkinsfile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 5a49ee8..ea9895a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -70,6 +70,17 @@ pipeline { stage('Cleanup') { steps { + echo 'Removing old/dangling Docker images...' + // Remove all images that are not associated with a container + // This targets the untagged images created by previous builds + sh 'docker image prune -f' + + // OPTIONAL: Remove images older than a certain time (e.g., 24 hours) + // This is useful if you want to keep the most recent successful images + // for quick rollback, but remove others. + // sh 'docker image prune -a -f --filter "until=24h"' + + echo 'Docker images pruned.' // Optional: Stop old containers and run the new ones // Note: In production, you would push to a registry (DockerHub) instead sh "echo 'Build Complete. Images ready: ${FRONTEND_IMAGE} and ${BACKEND_IMAGE}'"