Ruby on Rails app that powers https://crimethinc.com
First things first, Strap your computer’s development environment.
open https://strap.mikemcquaid.com/strap.sh
Then…
bash ~/Downloads/strap.sh
rm -f ~/Downloads/strap.sh
git clone https://github.com/crimethinc/website.git
cd website
./script/bootstrap
source ~/.bash_profile
./script/setup
overcommit --install
./script/server
The CrimethInc. website uses the Scripts to Rule Them All pattern. See also: https://github.com/github/scripts-to-rule-them-all
/script
is a collection of scripts for development on an macOS computer.
Development setup on a Windows or Linux computer will likely vary.
If any of these scripts fail for you, file an issue with as much detail about your setup and any errors you got from the script, and we’ll try to fix whatever’s happening.
The rest of these instructions assume that you’ve strapped your computer already. If you haven’t, you’ll need to install somethings manually. (But really, you’re better off using Strap.)
- Homebrew
- Homebrew taps and extensions
- Xcode command line tools
- Postgres launchctl (for
setup
script)
The bootstrap
script is the first time development environment configuration for this app.
You should only need to run this script once.
It will install the proper Ruby and PostgreSQL database versions.
Clone this repo.
git clone https://github.com/crimethinc/website.git
cd website
Then run the bootstrap
script.
./script/bootstrap
After you’ve bootstrap
ed, you’ll need to setup
.
The setup
setups the Rails environment (creates, migrates and seeds databases, then clears logs and tmp).
./script/setup
The server
script starts the Rails server on port 3000
(which uses Puma).
./script/server
Periodically, you can run the update
script to check for new versions of dependencies and to update the database schema. If you ever get a PendingMigrationError
, run this script to migrate your database.
./script/update
Run the test suite using the test
script.
./script/test
To run a process which runs tests on file change
./script/test_server
If you need to use the app’s console (in any environment), use the console
script.
./script/console
If you need to use the console on a remote instance of the app, specific its environment name as the first argument.
./script/console production
Or
./script/console staging
Setup environment for CI to run tests. This is primarily designed to run on the continuous integration server.
./script/cibuild
Drop the database, rebuild it, and fill it with seed data.
./script/seed
- Add a new language to
/languages
- Add a new locale
- Publishing workflow
- To Change Everything, language translations
- For Docker based development docs here
- "Can’t Find Postgresql" Error docs here
- "Can’t Load Gem from /vendor" Error docs here
- Site’s running locally, but there are no articles? docs here
See CONTRIBUTING.md.
If you find bugs, have feature requests or questions, please file an issue.
Everyone interacting in all of CrimethInc. codebases, issue trackers, chat rooms, and mailing lists is expected to follow the CrimethInc. development code of conduct.
PUBLIC DOMAIN
Your heart is as free as the air you breathe. \ The ground you stand on is liberated territory.
In legal text, CrimethInc. website is dedicated to the public domain using Creative Commons — CC0 1.0 Universal.