-
-
Notifications
You must be signed in to change notification settings - Fork 8
Team configuration sharing
Share database configurations across your development team using a private repository and symlinks. This approach ensures consistent configurations while maintaining security.
Create a private Git repository for your team's database configurations.
Recommended Structure:
mage-db-sync-databases/
├── production.json
├── staging.json
└── custom-commands/
└── project-name/
├── database.txt
└── magerun2.txt
Add your database configuration files to the repository:
-
production.json- Production environment credentials -
staging.json- Staging environment credentials -
custom-commands/- Project-specific command scripts (optional)
Important: Never commit this repository to public version control.
Clone the private repository alongside your mage-db-sync installation:
cd ~/.mage-db-sync
git clone [email protected]:your-team/mage-db-sync-databases.gitExpected Directory Structure:
~/.mage-db-sync/
├── config/
│ └── databases/
└── mage-db-sync-databases/
├── production.json
├── staging.json
└── custom-commands/
Navigate to the databases configuration directory and create symlinks:
cd ~/.mage-db-sync/config/databasesLink Configuration Files:
ln -s ../../../mage-db-sync-databases/production.json production.json
ln -s ../../../mage-db-sync-databases/staging.json staging.json
ln -s ../../../mage-db-sync-databases/custom-commands custom-commandsVerify Symlinks:
ls -laYou should see symlinks pointing to your private repository files.
Version Control
- Track configuration changes over time
- Review updates before applying
- Revert to previous configurations easily
Team Synchronization
- All team members use identical configurations
- Updates propagate automatically via git pull
- Reduces configuration-related issues
Security
- Credentials stored in private repository only
- No sensitive data in public repositories
- Centralized access control
Maintenance
- Update configurations in one place
- Changes available to entire team
- Simplified onboarding for new developers
# Clone the private configuration repository
cd ~/.mage-db-sync
git clone [email protected]:your-team/mage-db-sync-databases.git
# Create symlinks
cd config/databases
ln -s ../../../mage-db-sync-databases/production.json production.json
ln -s ../../../mage-db-sync-databases/staging.json staging.json
ln -s ../../../mage-db-sync-databases/custom-commands custom-commands# Pull latest configurations
cd ~/.mage-db-sync/mage-db-sync-databases
git pull origin main
# Changes are immediately available via symlinks# Edit configuration in the repository
cd ~/.mage-db-sync/mage-db-sync-databases
nano production.json
# Commit and push changes
git add production.json
git commit -m "Add new production database configuration"
git push origin main
# Team members pull updates
git pull origin mainRepository Management
- Use descriptive commit messages for configuration changes
- Review changes before committing credentials
- Implement branch protection for production configurations
- Regular audits of access permissions
Security
- Restrict repository access to authorized team members only
- Use SSH keys for authentication
- Consider encrypting sensitive values with tools like git-crypt
- Never commit SSH private keys to the repository
Documentation
- Include README with setup instructions in repository
- Document any project-specific configuration requirements
- Maintain changelog of significant configuration updates
Testing
- Test configuration changes in staging first
- Verify symlinks after repository updates
- Validate credentials before committing
Symlink Not Working
# Remove broken symlink
rm production.json
# Recreate with correct path
ln -s ../../../mage-db-sync-databases/production.json production.jsonPermission Issues
# Check repository permissions
ls -la ~/.mage-db-sync/mage-db-sync-databases/
# Ensure files are readable
chmod 644 ~/.mage-db-sync/mage-db-sync-databases/*.jsonRepository Not Found
# Verify repository was cloned correctly
ls ~/.mage-db-sync/mage-db-sync-databases/
# If missing, clone again
cd ~/.mage-db-sync
git clone [email protected]:your-team/mage-db-sync-databases.git