MongoDB Automation is a way to provide automation for all things MongoDB. There are 2 focus points to this repo:
- Deployment Scripts
- Backup/Restore
- Business Manual Data Adjust/Manual Data Entry
The idea is to push a seperate repository of .js scripts to run against a Mongo Deployment. This could also be run in the working repository if desired
The process can be broken down as the following:
- Staged workflow with a stage per environment
- Add approver/audit step as needed before executing next stage
- Step logic includes the
mongosh --file
command which will connect to a specific cluster and run the specified .js file as a script- Sensitive data, such as cluster userName and secret can be configured in Github Secrets and leveraged within Github Actions
- Example of a .js file can be found here, checkout all of the .js commands
Automate restores by creating a CD process to restore to the latest backup available
Steps:
- Get latest backup
- Restore latest backup through mongosh
Create a CD process to run MongoDB Ops against a particular collection
Steps:
- Get inputs from user
- Run operation