- Make sure you have the development dependencies installed
- Place GTFS .zip files, OSM files, and elevation .tif files (optional) in the otp_data folder
- Copy
deployment/ansible/group_vars/development_template
todeployment/ansible/group_vars/development
and edit variables - Run
vagrant up
- See the app at http://localhost:8024! See OpenTripPlanner at http://localhost:9090.
- Running
npm run gulp-watch
from/opt/app/src
will automatically collect static files together when changes are detected for Django template consumption.
- Make a production group_vars file (similarly to how is described above with development). Make sure production is set to true, and also specify an app_username, which should be set to: ubuntu
- If building the
otp
machine, make sure the latest GTFS are inotp_data
, then build a graph when them in the development environment provisioning. This will result in a newGraph.obj
file being written tootp_data
. - In the project directory within the app VM, run:
deployment/cac-stack.py create-ami --aws-access-key-id YOUR_ACCESS_KEY --aws-secret-access-key YOUR_SECRET_KEY --aws-role-arn YOUR_ASSUMED_ROLE_ARN
- The previous command builds all AMIs. To only build a single AMI, run the same command, but also specify the
--machine-type
parameter, which may be set to one of:bastion
,otp
, orapp
.
- Copy
deployment/default_template.yaml
todeployment/default.yaml
and edit variables - In the project directory, for a set of
Blue
stacks in theProduction
environment, run:deployment/cac-stack.py launch-stacks --stack-type prod --stack-color blue --aws-access-key-id YOUR_ACCESS_KEY --aws-secret-access-key YOUR_SECRET_KEY --aws-role-arn YOUR_ASSUMED_ROLE_ARN
- The previous command will do the following:
- Ensure the
VPC
stack is up in Production -- it will be launched if it isn't already running - Ensure the
DataPlane
stack is up in Production -- it will be launched if it isn't already running - Ensure the
OtpServer
Blue stack is up in Production -- it will be launched if it isn't already running - Ensure the
WebServer
Blue stack is up in Production -- it will be launched if it isn't already running
- Note that database migrations are not automatically run. When the DataPlane is first brought up, it is necessary to manually create the app user/db and run migrations.
- Launching a set of Production stacks with the other color (
Green
), will use the sameVPC
andDataPlane
stacks, but will create differentOtpServer
andWebServer
stacks (if they don't already exist).
- Note which color is currently running in production. Use the opposite color in the following steps.
- Set
otp_host
in production group_vars to the CloudFront distribution with the desired color. - Run
create_ami
command to build new AMIs. - Update
default.yaml
with new AMI ids. - Run
launch_stacks
command to launch stacks with the desired color. - Test new stacks thoroughly.
- Switch the public DNS record of the site to point to the new
WebServer
ELB DNS. - The stacks of the previous color may be deleted when ready.