- Github issue created or assigned.
- Feature branch is created based on the latest from the
master
branch.- Developer forks the repository if (s)he isn't part of the core team and thus does not have permission to commit to the main CrisisCleanup repo.
- Local development and testing is performed including writing unit and functional tests for new features and bugs.
- Create a pull request into the
master
branch. Add reviewers and comments. (will trigger CircleCI) - Reviewers will then approve the PR, provide feedback, and then merge into the
staging
environment.
- Reviewer triggers a staging environment deployment
- Testers verify PR/issue in the staging environment.
- All parties approve developer PR. Reviewer merges and closes PR into master and triggers a production deployment.
- Smoke testing in
production
environment
docker 1.17+
anddocker-compose 1.22+
- Clone repo:
git clone git@github.com:CrisisCleanup/crisiscleanup.git
- Clone fork, if applicable, instead of main repo.
cd crisiscleanup
- API keys and environment variables
- Create your own
.env.docker
in the repository base, based on.env.development.sample
.- i.e.
cp .env.docker.sample .env.docker
and replace the values in.env.docker
- i.e.
- (Required) You will need your own Google Maps API key
- (Optional) You will also need to use your own Google reCAPTCHAv2 Site/Secret key if you need to develop user forms.
- (Optional) You will also need to use your own AWS API key if you need to develop SNS or S3 features.
- Create your own
docker-compose build
docker-compose up -d
docker-compose exec web bash -c "yarn install"
- Install yarn dependencies manuallydocker-compose exec web bash -c "RAILS_ENV=docker bin/rake db:setup"
- Run seed migrations- Access web app at
http://localhost:8080
- Web container will hot-reload with code changes
docker-compose up -d
- Start all containersdocker-compose stop
- Stop all containersdocker-compose restart web
- Restart web container manuallydocker-compose stop web && docker-compose rm web && docker-compose build --no-cache web && docker-compose up -d web
- Stop, remove, clean build, and re-deploy web container onlydocker-compose down -v
- Take down entire app including postgres data volumesdocker-compose exec web bash -c "RAILS_ENV=docker bin/rake db:setup"
- Run seed migrations
docker-compose exec web bash -c "RAILS_ENV=test POSTGRES_HOST=postgres bin/rake db:create"
docker-compose exec web bash -c "RAILS_ENV=test POSTGRES_HOST=postgres bundle exec rspec"
- Ruby 2.2.5 (use rbenv or RVM)
- with
bundler
gem installed i.e.gem install bundler
- with
docker
anddocker-compose
node/npm
(Optionally, but preferred also installyarn
)
- Homebrew
- Command-line tools - either install Xcode or run
xcode-select --install
from a terminal - Postgres headers (for
pg
gem installation) -brew install postgres
- Clone repo:
git clone git@github.com:CrisisCleanup/crisiscleanup.git
- Clone fork, if applicable, instead of main repo.
cd crisiscleanup
bundle install
docker-compose up -d postgres redis
(docker should be installed and running)- API keys and environment variables
- Create your own
.env.development
in the repository base, based on.env.development.sample
. - (Required) You will need your own Google Maps API key
- (Optional) You will also need to use your own AWS API key if you need to develop SNS or S3 features.
- Create your own
- Data Migration -
- Using seed data:
bin/rake db:setup
(creates and migrates in one step)- (Mac/HomeBrew) If you encounter an error about byebug and readline, you can work around it by symlinking readline:
ln -s /usr/local/opt/readline/lib/libreadline.dylib /usr/local/opt/readline/lib/libreadline.6.dylib
- (Mac/HomeBrew) If you encounter an error about byebug and readline, you can work around it by symlinking readline:
- (OPTIONAL) Using a DB dumpfile:
bin/rake db:create
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U postgres -d postgres dev.dump
(PW: crisiscleanup)
- Using seed data:
- Use NPM or YARN to install node dependencies
- For
NPM
:npm install
- For
YARN
:yarn
(preferred)
- For
- Server Start
bin/rails server
- App should be available athttp://localhost:3000
- Default credentials:
- Admin user:
admin@example.com
with passwordpassword
- Primary Contact user:
demo@crisiscleanup.org
with passwordpassword
- Admin user:
- Default credentials:
- Testing
chromedriver
is required for now (usehomebrew
or place binary onPATH
)RAILS_ENV=test bundle exec rspec
- Cleanup
docker-compose down -v
(will destroy your local dev database)