-
Notifications
You must be signed in to change notification settings - Fork 0
Development
This page documents useful commands you may need when working on the Lamorinda Spirit Van project during local development, testing, and debugging.
Run these commands after cloning the project and installing dependencies to initialize your local database:
You can view all available Rake tasks with:
rake --tasks
All-in-one Rake task command that resets the database, runs migrations, seeds, and imports data:
rake setup:all
Standard setup commands:
# Drop the database (use only if you want to reset from scratch)
rake db:drop
# Create the database
rake db:create
# Run all migrations
rake db:migrate
# Seed with base data
rake db:seed
# Import mock address, passenger, and ride data
rake import:all
Blazer queries are stored as model records in the database, they will not persist through database drops, we made a rake script to save and import these queries:
You can save the current blazer queries to blazer_queries.yml:
rake blazer:export
You can import the saved blazer queries to the current database:
rake blazer:import
Use the following commands to verify that everything is working:
bundle exec rspec # Run RSpec unit and integration tests
bundle exec cucumber # Run Cucumber feature tests
After running tests, you can open the SimpleCov HTML report locally:
open coverage/index.html
First, ensure xdg-utils
is installed:
sudo apt install -y xdg-utils # -y auto-confirms installation
Then open the report with:
xdg-open coverage/index.html
This report shows line-by-line test coverage for the codebase, including both RSpec and Cucumber tests.
We use Just the Docs to manage the user instruction site.
If the application changes in a way that affects user behavior, the corresponding help documentation should be updated.
To run the documentation site locally, use the following commands:
cd docs
bundle exec jekyll server
The documentation is published online via GitHub Pages. We adopt the "Publishing with a custom GitHub Actions workflow" approach for deployment.
If you need to manually push local changes to Heroku and reinitialize the remote database, follow the steps below.
If this is your first time using Heroku CLI on this machine, log in via:
heroku login -i
This will open a browser window to authenticate your Heroku account.
git branch --show-current # Shows your current Git branch
heroku apps # Lists your Heroku apps
Check whether the heroku
remote is configured:
git remote -v
If not, add it by replacing <your-app-name>
with your actual Heroku app name:
heroku git:remote -a <your-app-name>
You should now see heroku
listed as a Git remote.
Replace your-branch-name
with the result of git branch --show-current
:
git push heroku your-branch-name:main
Example:
git push heroku 85-feat-password-reset-emails:main
If you are using the default remote (heroku):
heroku pg:reset --confirm <your-heroku-app-name>
heroku run rake db:migrate
heroku run rake db:seed
heroku run rake import:all
heroku restart
If you are using a custom remote (e.g., my):
heroku pg:reset --remote my --confirm <your-heroku-app-name>
heroku rake db:migrate --remote my
heroku rake db:seed --remote my
heroku rake import:all --remote my
heroku restart --remote my
To simplify future command usage, you can rename the heroku
remote:
git remote rename heroku my
After this, use --remote my
instead of --remote heroku
in all future commands.
If you are running into environment or setup issues, please refer to the Getting Started page for full setup instructions.
Before deploying to Heroku, make sure all required environment variables have been properly configured. See Environment Configuration for details.