Skip to content

PRX/cms.prx.org

Repository files navigation

PRX.org CMS API

License Code Climate Coverage Status Dependency Status

Description

This Rails app provides the CMS API for https://beta.prx.org.

It follows the standards for PRX services.

A HAL browser to try out the API is available: https://cms.prx.org/browser/index.html

Integrations & Dependencies

Installation

CMS now works in Docker. You should use Docker.

Basics

# Homebrew - http://brew.sh/
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

# Git - http://git-scm.com/
brew install git

# Get the code
git clone git@github.com:PRX/cms.prx.org.git
cd cms.prx.org

Environment

You'll need to cp env-example .env and include your credentials.

Docker Development

Currently on OSX, Dinghy is probably the best way to set up your dev environment. Using VirtualBox is recommended. Also be sure to install docker-compose along with the toolbox.

# Build the `web` container, it will also be used for `worker`
docker-compose build

# Start the mysql `db` - if this doesn't work, try a "docker-compose up" first,
# kill that, and then run this command again
docker-compose start db

# ... and run migrations against it
docker-compose run cms setup
docker-compose stop

# Test
docker-compose run cms test

# Guard
docker-compose run cms testsetup
docker-compose run cms guard

# Run the web, worker, and db
docker-compose up

Database bootstrapping

This project uses the prx.org database. So you'll need to get a backup of it to restore to your local development/test databases.

Assuming you have SSH keys for deploy@cms.prx.org, you can automatically do this!

# Create a new mysqldump (usually you can skip this step)
bundle exec rake db:proddump

# Copy the sql.gz files to your local tmp/dbbootstrap directory
bundle exec rake db:prodcopy

# Now you can restore your local database! (Uses db in your .env file)
bundle exec rake db:bootstrap

# Or to restore your docker-compose database...
docker-compose run cms bootstrap

License

AGPL License

Contributing

Completing a Contributor License Agreement (CLA) is required for PRs to be accepted.