wowonrails / qae

Queens Award for Enterprise Application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Circle CI Code Climate Test Coverage

Logo Queen's Awards for Enterprise

"QAE" is the application which powers the application process for The Queen's Awards for Enterprise.

Setup

Pre-requisites

  • Ruby 2.3.1
  • Rails 4.2
  • Postgresql 9.4
  • Redis 2.8

Running application

./bin/setup
foreman start

Running with convox locally

Install docker, and install convox

convox start -f docker-compose.yml.local
docker exec qae-web bundle exec rake db:schema:load db:migrate db:seed

Install Poxa

If you need to test collaborators editing the application at the same time, install poxa.

https://github.com/bitzesty/qae-poxa/blob/master/QAE_README.md#setup-on-local

Deploying

Continuous Deployment is setup and the application will automatically deploy after passing CI on the target branch (master, staging, deployment).

You can run a manual deploy if needed:

convox switch bitzesty/qae

convox deploy -a qae-dev

You may also need to run a rake task for database migrations manually:

convox run web rake db:migrate -a qae-dev

Dev

convox deploy -a qae-dev
convox run web rake db:migrate -a qae-dev

Staging

convox deploy -a qae-staging
convox run web rake db:migrate -a qae-staging

Production

convox deploy -a qae-production
convox run web rake db:migrate -a qae-production

Usefull commands

Rails console
convox run web rails console -a <CONVOX_APP>
Logs
convox logs -a <CONVOX_APP>

Filtering by key word and date.

convox logs -a qae-qev --filter=SubmissionDeadlineApplicationPdfGenerationWorker --since=27h

In this example it fetches logs for latest 27 h with keyword "SubmissionDeadlineApplicationPdfGenerationWorker"

Better logs in Papertrail for QAE.

https://papertrailapp.com

Login in last pass

Deploy without cache
convox deploy -a <CONVOX_APP> --no-cache

Help

If you see the following error:

ActiveRecord::StatementInvalid: PG::UndefinedFile: ERROR:  could not open extension control file "/usr/share/postgresql/9.3/extension/hstore.control": No such file or directory
: CREATE EXTENSION IF NOT EXISTS "hstore"

This means, that hstore postgresql extension needs to be installed:

sudo apt-get install postgresql-contrib

Check Cron schedule on live

https://www.queens-awards-enterprise.service.gov.uk/sidekiq/cron

Profile mode in Development

To enable rack mini profiler in development mode set in .env:

PROFILE_MODE=true

About

Queens Award for Enterprise Application

License:MIT License


Languages

Language:Ruby 55.5%Language:HTML 28.1%Language:CSS 9.6%Language:CoffeeScript 5.5%Language:JavaScript 1.2%Language:Gherkin 0.1%Language:Shell 0.0%