Here's how to run Monorail locally for development on MacOS and Debian stretch/buster or its derivatives.
You need to get the Chrome Infra depot_tools commands to check out the source code and all its related dependencies and to be able to send changes for review.
Check out the Monorail source code
cd /path/to/empty/workdirfetch infracd infra/appengine/monorailSet up the gcloud CLI
gclient runhooks)workdir/gcloud/bin to PATH in .zshrcgcloud auth logingcloud auth application-default logingcloud config set project monorail-devInstall MySQL v5.6.
brew install mysql@5.6Set up SQL database. (You can keep the same sharding options in settings.py that you have configured for production.).
mysql --user=root -e 'CREATE DATABASE monorail;'mysql --user=root monorail < schema/framework.sqlmysql --user=root monorail < schema/project.sqlmysql --user=root monorail < schema/tracker.sqlexitConfigure the site defaults in settings.py. You can leave it as-is for now.
Set up the front-end development environment:
sudo apt-get install build-essential automakeInstall node version manager brew install nvm
See the brew instructions on updating your shell's configuration
Install node and npm nvm install 12.13.0
Add the following to the end of your ~/.zshrc file:
export NVM_DIR="$HOME/.nvm" [ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm [ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
Install JS dependencies:
make jsdepsRun the app:
brew services restart mysql@5.6mysqldmake serveBrowse the app at localhost:8080 your browser.
Create your test user accounts 1. Sign in using test@example.com 1. Log back out and log in again as example@example.com 1. Log out and finally log in again as test@example.com 1. Everything should work fine now.
Modify your Monorail User row in the database and make that user a site admin. You will need to be a site admin to gain access to create projects through the UI.
mysql --user=root monorail -e "UPDATE User SET is_site_admin = TRUE WHERE email = 'test@example.com';"