Public Repository

Last pushed: 5 months ago
Short Description
production civchoice
Full Description

<!-- To convert this file to html: gem install markup redcloth markup [-F] open README.html You may want to install the markdown syntax for vim: -->

CivChoice Dev Starter Pack

So you just cloned this repo, now what ?

  1. Follow the steps in this link to get docker set up:
    • If this is your first time doing a docker-compose up remember to uncomment the lines in to seed your database.
    • You will want to add the following line of code to your bash profile in order to keep your database properly connected: eval $(docker-machine env)
    • Commands to remember by heart and in order
      • docker-machine start default
      • docker-machine env
      • docker-compose up
    • Dashboard folder on the root directory is a Sinatra app
      • Making changes in the Sinatra controllers requires an application restart to see the changes. Follow these steps to apply the changes in sinatra.
        • Docker-compose stop
        • rm -rf tmp/pids
        • Docker-compose up
      • Cause: Errno::ECONNREFUSED | Fix: rake sunspot:solr:start
      • Cause: old pids | Fix: rm -rf tmp/pids
      • will add more later . . .

Great! The app is running locally but I want to BASH it

  1. Open a new terminal and run this command
    docker-compose run --rm app bundle exec bash

    IRS rake ENV Variables

    Bash to your apps container ( see above topic about bashing )

Step 1: Initialize your ENV variables

  1. export DIR='tmp'
  2. export LAST_BATCHDATE='YYYY-mm-dd' (insert the last time you ran the IRS update)
  3. export BATCHDATE='YYYY-mm-dd' (check IRS website for actual date)
  4. export URL=''

Step 2:

  1. rake irs:prepare:download

Downloads the csv files from the IRS website and put it in our tmp directory

  1. rake irs:load:all

Grabs the downloaded csv files in our tmp directory and create/update IrsRecord entries based on the csv files

  1. rake irs:load:profiles

Create/updates Profile entries based on the IrsRecord table


Please be familiar with the standard Cirrusmio development practices
by reading Git Strategy and Docker Info
on Internal Web,
as well as the Ruby Styleguide.

ERD (Entity Relationship Diagram)

We use the rails-erd gem to generate entity-relationship diagrams.

You'll need some additional packages to render the dotfile;
you may want to put the following in

apt-get install --yes graphvis

and then run

docker-compose run app bundle exec rake erd

Afterwards you should have a file named ERD.pdf in the project root directory.


Be familiar with the Moving to Production page
in the internal-web repo.

In development, run locally in docker-machine.
Use local services
(e.g., file-based delivery for email, file storage for uploaded files, etc)
instead of cloud-based services.

When working on features that add cloud components
(e.g., uploads that store in S3)
use your [AWS personal account][aws-personal-account] to debug your changes
to the CloudFormation templates and the code that powers your feature,
and to create and store VCR cassettes for test playback.

Working code (release candidates, essentially) should be merged into master.
A merge to master should redeploy the application to the staging server.
Use github, semaphore, and tutum integrations to automate staging deploys.

Production code is deployed by logging into the AWS account to run any
template updates that are required to add new services.
The production Docker Cloud account uses the image repository from staging.
You can manually deploy production, taking the last known-good staging release
and deploying it across the docker nodes.

AWS Services

  • CloudFormation to set up almost everything else
  • S3 Buckets for file uploads
  • S3 Buckets for assets
  • CloudFront for distributing assets
  • SES for sending all emails
  • SNS for email bounce/report notifications
  • RDS for the database
  • DNS in Route53
  • Key Service for SSL certificates.
  • ELB for load balancing & SSL termination (and backend isolation)
  • EC2 for running the docker-cloud launched worker node

Other Services

  • Facebook Auth
  • Google OAuth2
  • Recaptcha for humanness-verification
  • Airbrake for exception reporting
  • FirstData Gateway Connect v4 for CreditCard & ECheck processing
  • Paypal for donation processing
  • Redis container for page cache & background processing management
Docker Pull Command