- Ruby 59.4%
- Haml 27.3%
- CSS 5.9%
- JavaScript 3.9%
- SCSS 2.4%
- Other 1.1%
Treehouse
This Rails application provides services used by members of the Treehouse Village Ecohousing community.
Development setup
-
Set up your local environment using
asdf. Alternatively, feel free to skip the following and install Ruby, Postgresql and NodeJS manually.To set up your environment with
asdf:- Install asdf locally.
- Make sure you install dependencies needed for the asdf Postgres plugin.
- If you're a Debian-based distro user, you may also want to add the
following package:
libpq-dev.
- Install all
asdfplugins needed for this project, get all needed gems and setup your local database by running the following:
bin/dev_setup -
At this point, your local database will be setup for the application. It's time to seed it:
bundle exec rails db:seed -
Finally, start your server to access the app by running:
foreman startThe app is now available at http://localhost:3000. To log in with an admin, use
admin@example.com. Otherwise, useuser@example.com. The password for both these accounts ispassword.
Tests
To run all tests:
bundle exec rspec
Deployments
To deploy main to home.treehousevillage.ca, simply run the following from
the project root:
bin/deploy
This script will first run all tests, and if no test fails, then it will proceed with the deployment.
What if something is broken after deployment?
No worries! Take a deep breath then run the following command from the project root:
bundle exec cap production deploy:rollback
This will revert to the previous deployed revision (side note: the last 5 deployment revisions are kept on the server).
After this rollback has taken effect and you've checked that everything is working again, please consider writing a test will cover this scenario.
Maintenance mode
On the server:
touch ~/maintenance_is_enabled
Remove the file to leave maintenance mode.