I am rather new to DevOps. Trying to organize my project for continuous integration (CI), I am facing a problem for which I haven't been able to find a solution yet. I would like to know what is the best way to manage my database file(s) in the setup that I have so that the latest version of DB can be accessed by developers as well as Jenkins.
Similar questions have been touched on in various threads, such as the ones below. But none answered the question specific to my situation.
- Database CI with Jenkins: A step by step tutorial
- How can I put a database under git (version control)?
- Using version control (Git) on a MySQL database
- Is backing up a MySQL database in Git a good idea?
Setup
Here is what my setup looks like:
- Language: Python 3.5 (with unittests, etc.)
- Database: MySQL - the data updates once a day (not the schema)
- Version Control: Git
- Code Hosting: Bitbucket
- Development OS: Windows 10
- CI Machine: Amazon AWS EC2 running Linux (Ubuntu 16.04.1)
- CI Tool: Jenkins
I have set up the CI such that whenever I update origin/master, Jenkins runs the tests on the AWS machine.
EDIT To clarify what my database is, suppose it is some kind of daily sales figures or daily market update. I have a code to update the db once a day and another program to perform some sort of data analytics on it.
Problem
I am not concerned about the version control of the database. In other words, I don't care what my DB was two days ago. However, since my database will be updated every day, I want different dev systems as well as Jenkins to access the latest every time a test is run. From what I have read so far, it is not good practice to include the database in my Git repository (and I wouldn't want to do that since I don't care about tracking changes on it). So the question is how should I store my database and integrate it into my project?
Some have suggested using Dropbox or other tools to access the DB anywhere. Is this the best approach? If yes, what exactly should be kept on Dropbox? Actual database (*.db) files and folders? In MySQL those are kept centrally in the /data/ folder of MySQL and I have no idea how to store them on another folder such as Dropbox.
Others suggested keeping a dump of the DB. What should the process be? To generate the dump after the daily change of the database and keep the .txt dump files on Dropbox? How would Jenkins re-create the DB from these dump files every time?