These steps should only need to be taken once when setting up a new development machine:
Install basic build dependencies:
sudo apt-get install git build-essential automake
$PATH
.Check out the Monorail source code repository:
mkdir ~/src/
cd ~/src/
fetch infra
(Googlers may alternatively fetch infra_internal
, but note that gclient sync
will then always sync based on the current infra_internal
branch instead of the current infra
branch.)cd infra/appengine/monorail
Install and configure the gcloud CLI:
fetch infra
above under ~/src/infra/cipd/gcloud/bin
. Add it to your PATH
in .bashrc
.sudo apt-get install -y google-cloud-sdk
)Configure gcloud:
gcloud auth login
gcloud config set project monorail-dev
Install and configure Docker:
sudo apt install docker-ce
(Googlers will need to follow instructions at go/docker)sudo systemctl start docker
sudo adduser $USER docker
docker run hello-world
to verify installation.gcloud auth configure-docker
Configure the MySQL database:
sudo apt install libmariadb-dev
docker cp schema/. mysql:/schema
docker exec -it mysql -- mysql --user=root monorail < schema/framework.sql
docker exec -it mysql -- mysql --user=root monorail < schema/project.sql
docker exec -it mysql -- mysql --user=root monorail < schema/tracker.sql
docker exec -it mysql -- mysql --user=root monorail -e "UPDATE User SET is_site_admin = TRUE WHERE email LIKE '%@example.com';"
Install Monorail frontend (node) prerequisites:
curl https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
source "$HOME/.nvm/nvm.sh"
nvm install 12.13.1
These steps will need to be repeated regularly when developing Monorail:
Enter the virtual environment (in every new terminal you create):
eval $(../../go/env.py)
source ./venv/bin/activate
Install per-language dependencies (every few days to ensure you're up to date):
make jsdeps
Launch the Monorail server (once per machine/per reboot):
make serve
Login with test user (once per machine or when starting with a fresh database): 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
.