forked from Nixius/authelia
Deploy: prune old images after deploy, document full rebuild/redeploy
Made-with: Cursor
This commit is contained in:
parent
ac24f6d1dc
commit
c3097bd8fe
|
|
@ -25,6 +25,10 @@ This directory contains comprehensive guides for Authelia deployment and configu
|
||||||
- Monitor deployment through Woodpecker CI
|
- Monitor deployment through Woodpecker CI
|
||||||
- Verify service health and authentication flows
|
- 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
|
## 🔑 Quick Reference
|
||||||
|
|
||||||
### Essential Commands
|
### Essential Commands
|
||||||
|
|
|
||||||
|
|
@ -400,6 +400,13 @@ comprehensive_health_check() {
|
||||||
return 0
|
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 deployment function
|
||||||
main() {
|
main() {
|
||||||
log "🚀 Starting production deployment for ${CI_REPO_NAME}"
|
log "🚀 Starting production deployment for ${CI_REPO_NAME}"
|
||||||
|
|
@ -434,6 +441,9 @@ main() {
|
||||||
# Step 7-9: Rapid health checking with container diagnostics
|
# Step 7-9: Rapid health checking with container diagnostics
|
||||||
comprehensive_health_check
|
comprehensive_health_check
|
||||||
|
|
||||||
|
# Step 10: Remove old image versions from the node
|
||||||
|
prune_old_images
|
||||||
|
|
||||||
success "🎉 Production deployment completed successfully!"
|
success "🎉 Production deployment completed successfully!"
|
||||||
success "🏆 Deployed image: $NEW_IMAGE_HASH"
|
success "🏆 Deployed image: $NEW_IMAGE_HASH"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue