added jenkins deployment

This commit is contained in:
2025-12-10 15:23:15 -05:00
parent 9740db54f7
commit 8704cabed3

11
Jenkinsfile vendored
View File

@@ -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}'"