forked from Nixius/authelia
1
0
Fork 0

Deploy: prune old images after deploy, document full rebuild/redeploy

Made-with: Cursor
This commit is contained in:
Leopere 2026-03-03 11:35:07 -05:00
parent ac24f6d1dc
commit c3097bd8fe
Signed by: colin
SSH Key Fingerprint: SHA256:nRPCQTeMFLdGytxRQmPVK9VXY3/ePKQ5lGRyJhT5DY8
2 changed files with 14 additions and 0 deletions

View File

@ -25,6 +25,10 @@ This directory contains comprehensive guides for Authelia deployment and configu
- Monitor deployment through Woodpecker CI
- Verify service health and authentication flows
4. **Full rebuild and redeploy (remove old stack/images)**
- Push to `main` (or run the production pipeline in Woodpecker). The pipeline: builds production images with `--no-cache`, pushes to registry, runs `scripts/ci-deploy-production.sh` (stack rm → wait → recreate secrets → deploy stack → health check → prune unused images).
- No manual steps on the swarm manager; everything runs in CI.
## 🔑 Quick Reference
### Essential Commands

View File

@ -400,6 +400,13 @@ comprehensive_health_check() {
return 0
}
# Remove all unused images (old stack versions) from the node
prune_old_images() {
log "Pruning unused images (removing old versions)"
docker image prune -a -f || warning "Image prune had non-fatal issues"
success "Old image versions pruned"
}
# Main deployment function
main() {
log "🚀 Starting production deployment for ${CI_REPO_NAME}"
@ -434,6 +441,9 @@ main() {
# Step 7-9: Rapid health checking with container diagnostics
comprehensive_health_check
# Step 10: Remove old image versions from the node
prune_old_images
success "🎉 Production deployment completed successfully!"
success "🏆 Deployed image: $NEW_IMAGE_HASH"
}