3.2 KiB
3.2 KiB
Mirroring CloudNativePG Barman Plugin
Setup Mirror Repository
-
Clone the upstream repository:
cd /tmp git clone --mirror https://github.com/cloudnative-pg/plugin-barman-cloud.git cd plugin-barman-cloud.git -
Push to your Git server:
# Create repo on your Git server first (git.mvzijl.nl) # Then push: git push --mirror https://git.mvzijl.nl/marco/plugin-barman-cloud.git -
Set up periodic sync (optional):
# Create a script to sync weekly cat > /usr/local/bin/sync-barman-plugin.sh <<'EOF' #!/bin/bash cd /var/git/mirrors/plugin-barman-cloud.git git fetch --prune origin git push --mirror https://git.mvzijl.nl/marco/plugin-barman-cloud.git EOF chmod +x /usr/local/bin/sync-barman-plugin.sh # Add to cron (weekly on Sunday at 2 AM) echo "0 2 * * 0 /usr/local/bin/sync-barman-plugin.sh" | crontab -
Update Application Reference
After mirroring, update the application.yaml to use your mirror:
spec:
source:
repoURL: https://git.mvzijl.nl/marco/plugin-barman-cloud.git
targetRevision: main # or specific tag like v1.0.0
path: deployments/manifests
Version Pinning Strategy
Instead of tracking main, pin to specific releases:
spec:
source:
repoURL: https://git.mvzijl.nl/marco/plugin-barman-cloud.git
targetRevision: v1.0.0 # Pin to specific version
path: deployments/manifests
This gives you:
- ✅ Predictable deployments
- ✅ Controlled updates
- ✅ Rollback capability
Update Process
When a new version is released:
-
Check upstream for updates:
cd /var/git/mirrors/plugin-barman-cloud.git git fetch origin git tag -l -
Review changes:
git log HEAD..origin/main --oneline git diff HEAD..origin/main deployments/manifests/ -
Sync to your mirror:
git push --mirror https://git.mvzijl.nl/marco/plugin-barman-cloud.git -
Update application.yaml:
targetRevision: v1.1.0 # Update to new version -
Test and deploy:
git add apps/cloudnative-pg-plugin/application.yaml git commit -m "Update barman plugin to v1.1.0" git push
Monitoring Upstream
Subscribe to releases:
- GitHub: Watch → Custom → Releases only
- RSS:
https://github.com/cloudnative-pg/plugin-barman-cloud/releases.atom
Alternative: Subtree Approach
Instead of mirroring, you could use git subtree:
cd /Users/marco/Documents/Hobby/Veda/talos
git subtree add --prefix vendor/plugin-barman-cloud \
https://github.com/cloudnative-pg/plugin-barman-cloud.git main --squash
# Then reference in application:
# path: vendor/plugin-barman-cloud/deployments/manifests
Update when needed:
git subtree pull --prefix vendor/plugin-barman-cloud \
https://github.com/cloudnative-pg/plugin-barman-cloud.git main --squash
Recommended Approach
For your setup, I recommend:
- Mirror to your Git server at
git.mvzijl.nl/marco/plugin-barman-cloud - Pin to specific versions (not
main) - Review updates before applying
- Set up monitoring for new releases
This gives you the best balance of control and maintainability.