|
1 | 1 | # mysql2sqlite-dev
|
2 |
| -Development environment for mysql2sqlite work |
| 2 | + |
| 3 | +Development environment for |
| 4 | +[mysql2sqlite](https://github.com/WhyAskWhy/mysql2sqlite) work. This repo may |
| 5 | +be folded into that repo at a later time. |
| 6 | + |
| 7 | +## Requirements |
| 8 | + |
| 9 | +In order to reduce setup requirements on the part of the developer, the scripts |
| 10 | +used by this project make multiple assumptions that the main project does not: |
| 11 | + |
| 12 | +- Ubuntu 16.04 |
| 13 | + - clean, without any packages already installed aside from OS and |
| 14 | + integration tools (e.g., Hyper-V, VirtualBox, VMware Tools) |
| 15 | +- Internet access (needed for installation and setup of packages) |
| 16 | + |
| 17 | +## Repo layout |
| 18 | + |
| 19 | +File/Path | Purpose | Notes |
| 20 | +--------- | ------- | ----- |
| 21 | +`bin` | Scripts meant to be used directly by developer| Most are used directly within the guest/VM, but some from Host system |
| 22 | +`bin/create_db.sh` | Run after the `bin/setup_dev_environment.sh` script in order to create SQLite database file | Usually run once |
| 23 | +`bin/rebuild_test_db.sh` | Run as-needed to reset db state after tinkering with the content. Convenience script only |
| 24 | +`bin/setup_dev_environment.sh` | Main setup script to kickstart a new dev environment | Usually run just once per new dev env |
| 25 | +`bin/sync_files.ps1` | Copy files from Hyper-V Host to Hyper-V guest | Alternative to first cloning this repo to get access to `bin/setup_dev_environment.sh` script |
| 26 | +`bin/validate_dbs.py` | Run after the `bin/create_db.sh` script to perform basic validation of newly created SQLite db. | WIP, future script that I hope to refactor and use as pre and post CI tools to confirm valid conversion results. This script may be moved to the main project in the near future. |
| 27 | +`bin/validate_dbs.sh` | Run after the `bin/create_db.sh` script to perform basic validation of newly created SQLite db. | DEPRECATED. This script will probably be removed in the near future as most of the functionality has been replicated by the `bin/validate_dbs.py` script |
| 28 | +`etc` | Configuration files for various dependencies/tools used within dev environment | Deployed as part of running the `bin/setup_dev_environment.sh` script |
| 29 | +`keys` | Local copy of upstream repo package signing keys | May be phased out if not proven useful |
| 30 | +`sql` | Import files used to setup database used by main project | Imported as part of running the `bin/setup_dev_environment.sh` script |
| 31 | +`LICENSE` | License for this collection of content | Intended to match the license used for main project |
| 32 | +`README.md` | Main doc file for this project | Please submit a PR or bug report for any missing or incorrect coverage |
| 33 | + |
| 34 | +## Dependencies |
| 35 | + |
| 36 | +### Gitea (or similar local Git mirror) |
| 37 | + |
| 38 | +To keep from abusing GitHub, VSTS and other Git "remotes", I run a local Gitea |
| 39 | +instance. This is entirely optional and can be overriden by adjusting the |
| 40 | +`MAIN_PROJECT_GIT_REPO_URL` and `THIS_DEV_ENV_GIT_REPO_URL` variables |
| 41 | +within the various build scripts to reference a different Git remote. |
| 42 | +Alternatives are provided, but commented out in case you wish to use them. |
| 43 | + |
| 44 | +You will find evidence of Gitea specified by the `local-mirror:3000` Git repo |
| 45 | +URLs in the various build scripts. |
| 46 | + |
| 47 | +### Squid proxy server |
| 48 | + |
| 49 | +Used much for the same reason as with the local Gitea instance, I run a local |
| 50 | +Squid VM to cache remote content for local rebuilds. |
| 51 | + |
| 52 | +Not yet included here, this proxy has been enabled by way of the |
| 53 | +`/etc/environment` and `/etc/apt/apt.conf` conf files. Those files were |
| 54 | +modified by way of the `Network proxy` configuration UI within the test VM. |
| 55 | +See the link below in the References section for details. |
| 56 | + |
| 57 | +Using this UI (or directly modifying the files mentioned) allows our Ubuntu |
| 58 | +16.04 test box to use the Squid proxy server for system-wide |
| 59 | +proxy use. This is of particular help with speeding up package installation |
| 60 | +for repeat builds. I like to also think that using local mirrors for builds |
| 61 | +is appreciated by upstream package mirror maintainers/owners. |
| 62 | + |
| 63 | +### Postfix |
| 64 | + |
| 65 | +As part of the setup work, Postfix is installed and configured to use local |
| 66 | +MySQL and SQLite databases for many of its lookup tables. This is intended |
| 67 | +to serve as a means of verifying that mysql2sqlite was successful in exporting |
| 68 | +entries from the MySQL tables to the local SQLite database. |
| 69 | + |
| 70 | +The idea is that if we get consistent, duplicate results when running |
| 71 | +postmap queries against both the MySQL and SQLite database tables then |
| 72 | +mysql2sqlite is working as intended. |
| 73 | + |
| 74 | +Listens on localhost only. |
| 75 | + |
| 76 | +### MariaDB |
| 77 | + |
| 78 | +The latest upstream version of MariaDB 10.0.x is installed and configured in an |
| 79 | +insecure manner for production purposes, but sufficient for our local testing |
| 80 | +needs. No password is set for the `root` account. |
| 81 | + |
| 82 | +Listens on localhost only. |
| 83 | + |
| 84 | +## Tools |
| 85 | + |
| 86 | +The following list of tools are installed as part of running the |
| 87 | +`bin/setup_dev_environment.sh` script during the initial test VM setup: |
| 88 | + |
| 89 | +- DB Browser GUI application |
| 90 | +- MySQL Workbench (or an alternative) |
| 91 | + |
| 92 | +These tools are meant to assist with taking a "hands-on" approach to |
| 93 | +troubleshooting issues with source and destination databases. |
| 94 | + |
| 95 | +## References |
| 96 | + |
| 97 | +- the local [docs/references.md](docs/references.md) file. |
| 98 | +- the main project [docs/references.md](https://github.com/WhyAskWhy/mysql2sqlite/blob/master/docs/references.md) file. |
0 commit comments