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/workdir
fetch infra
cd infra/appengine/monorail
Set up the gcloud CLI
gclient runhooks
)workdir/gcloud/bin
to PATH
in .zshrc
gcloud auth login
gcloud auth application-default login
gcloud config set project monorail-dev
Install MySQL v5.6.
brew install mysql@5.6
Set 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.sql
mysql --user=root monorail < schema/project.sql
mysql --user=root monorail < schema/tracker.sql
exit
Configure 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 automake
Install 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 jsdeps
Run the app:
brew services restart mysql@5.6
mysqld
make serve
Browse 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';"