Running it locally
To get this thing up and running in your own development environment,
you'll need to clone this project as well as the ansible setup and
the ansible source. (Ensure the ansible setup and the publishist repos are in
the same parent directory). Also, make sure you have Vagrant and VirtualBox
cd into the publishist directory and
Then go do some stretching/pushups/drinking. It'll be a bit of a wait.
Once it's done, you can
vagrant ssh to get into the VM where
Running the tests
Once you've got it up and running the first time, you'll have to run these before you can run the tests:
rake db:setup rake db:test:clone
Then you can run the tests/specs with these commands:
RSpec runs all of the specs in the
spec directory, while Cucumber runs all of
the "Features" in the
Running the app
To start the app locally and run it in your browser, first you'll need to:
rake db:setup echo RACK_ENV=development > .env && echo PORT=3000 >> .env
(If you haven't already.) This creates the database, loads in the schema from
db/schema.rb, then runs
rake db:seed which loads in all of the data from
db/seeds.rb. Then it creates a ".env" app that is used by Unicorn but not
commited in git.
to start the app. Once it says it's ready, visit problemchild.lvh.me:3000 in your browser.
lvh.me is a website that some helpful person set up that is just an alias for "localhost". So instead of visiting "localhost:3000", you can visit "lvh.me:3000". For Publishist to work, it needs a subdomain, and subdomains don't work with "localhost". So lvh.me is a nice fast way of getting it working.
Unfortunately, lvh.me requires internet connectivity. If you're going to be on
a plane or train and want to work on Publishist, you should consider setting up
/etc/hosts file to handle some subdomains for you. Here's how:
Go to your command line and use your favorite editor to open "/etc/hosts". For example:
Find the line that says
This line is just telling your computer that when you visit "localhost" in a browser, go to the IP address "127.0.0.1".
Add these lines:
127.0.0.1 publishist.dev 127.0.0.1 problemchild.publishist.dev 127.0.0.1 conspire.publishist.dev
Visit problemchild.publishist.dev:3000 in your browser. Huzzah!
Signing into the app
If you read db/seeds.rb, you'll see that two Publications will have been created for you, "Problem Child" and "Conspire". Here are some of their users that you can log in as:
The password for all of the users created by db/seeds.rb is "bubbles".