This repository is no longer used and the code has been integrated into github.com/alphagov/gsd-api
This is the publishing application for Government Service Data. This application interacts with the GSD API to provide data for View data
First you need the Ruby version defined in .ruby-version installed, which is currently 2.4.1. It's easy to switch Ruby versions on demand with rbenv, which you can do using Homebrew.
brew install rbenv
If you have rbenv installed, you can run
rbenv install 2.4.0
Next, you'll need Bundler in order to install all the dependencies you'll need to run the app.
gem install bundler
Installing Bundler means that you have it for the current version of Ruby. If you ever switch Ruby versions, you'll need to re-install Bundler. After bundle has been installed, install the dependencies for this application with
bundle
Once you have all the dependencies, you need to configure the database you will be using. Copy config/database.yml.example to config/database.yml to use the suggested database name. Once you have done this you should run
bin/rails db:create db:migrate db:seed
To start the server.
- You can check out
Powfor a really easy no-config server solution. - You can do the more conventional
rails -scommand. If you're already running another app on port 3000 (the API, for example), then pass in a new port number withrails -s --port 3000
You can test the server is up and running by visiting http://127.0.0.1:3000/v1/data/government or http://gsd-api.dev/v1/data/government if you are using Pow.
To run tests, you should run
bin/rails spec
Deployments are initiated by merging master into staging, and then pushing the staging branch.
The migrations aren't automatically run by CI on deployment. To run all pending migrations use the following: