Update clinic/service/Jenkinsfile.Web
This commit is contained in:
@@ -100,12 +100,21 @@ pipeline {
|
||||
} else {
|
||||
echo "No Docker image to clean up"
|
||||
}
|
||||
// Clean up dangling images and build cache
|
||||
sh "docker image prune -f || echo 'No dangling images to prune'"
|
||||
sh "docker builder prune -f || echo 'No build cache to prune'"
|
||||
// Clean up npm artifacts
|
||||
sh "rm -rf node_modules build || echo 'No npm artifacts to clean'"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
// Ensure workspace is cleaned up after every run
|
||||
cleanWs()
|
||||
}
|
||||
failure {
|
||||
echo "Pipeline failed! Check the logs for details."
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user