This is the repository of code for the Layers of London application, which will live at http://www.layersoflondon.org
Tech stack:
- Ruby: 2.5.0p0
- Rails: 5.2.0.rc1
- Mysql: 5.7
- Redis: 3.2
- Elasticsearch: 6.2.1
Add to your /etc/hosts
file, the following line:
127.0.0.1 webpack
Spin up the containers
$ docker-compose up -d
Known issue:
- When spin up containers for first time with
docker-compose up -d
, the migration in the entrypoint of the ruby service, might fail since the mysql service didn't finish the warm up. Solved by runningdocker-compose up -d
again
Elastic search is composed independently, to spin up the elastic search container run:
$ docker-compose -f docker-compose.elk.yml up -d
Elasticsearch-ruby client Chewy
to delete all documents of a type and reimports them
$ docker-compose exec ruby rails chewy:reset
./src/scripts/setup-pre-commit.sh
This script add pre-commit file to the git directory
BDD with Postman collections and newman
docker-compose exec -T ruby newman run LoL.postman_collection.json --globals LoL.postman_globals.json --environment Local.postman_environment.json
note: to run newman or postman runner, we must have all the docker containers running, including the elasticsearch service. We should change as well environment to development in devise.rb (config.http_authenticatable = Rails.env.development?) and in application_controller.rb
Mocha tests
docker-compose exec ruby rails RAILS_ENV=test db:reset
docker-compose exec ruby yarn run test
File > Settings > Languages & Frameworks > Ruby SDK and Gems > + > Select interpreter Path > New remote > Configure Remote Ruby interpreter > Dockerfile
Known issues & FAQ:
- Max virtual memory areas vm.max_map_count is too low, change it for amount suggested:
sudo sysctl -w vm.max_map_count=SUGGESTED_AMOUNT
The project is licenced GPL3