|
4 days ago | |
---|---|---|
app | 6 days ago | |
bin | 3 months ago | |
config | 6 days ago | |
db | 4 weeks ago | |
lib | 9 months ago | |
public | 1 month ago | |
spec | 3 weeks ago | |
storage | 1 year ago | |
vendor | 1 year ago | |
.gitattributes | 1 year ago | |
.gitignore | 10 months ago | |
.rspec | 1 year ago | |
.rubocop.yml | 7 months ago | |
.ruby-version | 1 year ago | |
.tool-versions | 4 months ago | |
Capfile | 9 months ago | |
Gemfile | 7 months ago | |
Gemfile.lock | 7 months ago | |
LICENSE | 4 days ago | |
Procfile | 7 months ago | |
README.md | 3 months ago | |
Rakefile | 9 months ago | |
config.ru | 9 months ago |
README.md
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, NodeJS and Redis 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
asdf
plugins 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 start
This will start your Rails (Puma) server as well as Sidekiq and Redis. If you only want to start your server, run:
bundle exec rails server # or 'rails s'
The 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.
Update secrets
To update the application secrets, first ask a developer to give you the
master.key
file. Once you received it, place it in the config
folder.
You can then run the following to update the application secrets:
rails credentials:edit