mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-27 04:51:14 +00:00
1.8 KiB
1.8 KiB
Development
Install instructions in INSTALL.md
Startup
Just run and open http://localhost:4000/
docker-compose -f docker-compose.dev.yml up`
Tips
- Everything should be running on containers.
- If you need to run stuff on your host (eg. ruby, rubocop, bundle install etc) run all commands from the:
Dockerfile.dev
. It should setup identical setup for your machine. - Add docker container names to /etc/hosts. This makes it possible to run test from local machine without using the container since editor/IDE don't integrate with Docker so well.
sudo echo
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ensl_dev_db
db >> /etc/hosts - VS Code and RubyMine are great IDE's/editors.
- To run VS Code plugin Ruby Test Explorer in docker container you need to create path to custom
- Do not commit too much without testing. Also keep commits small for documentation and reversability issues.
Best practices
- https://nvie.com/posts/a-successful-git-branching-model/
- https://github.com/rubocop-hq/ruby-style-guide
- https://rails-bestpractices.com/
- http://www.betterspecs.org/
- https://github.com/rubocop-hq/rspec-style-guide
- Run rubocop
Handy commands
To get inside docker web+test containers:
docker-compose -f docker-compose.dev.yml exec -u root web /bin/bash docker-compose -f docker-compose.dev.yml exec -u web web /bin/bash
docker-compose -f docker-compose.dev.yml exec -u root test /bin/bash docker-compose -f docker-compose.dev.yml exec -u web test /bin/bash
Restart the web container
docker-compose -f docker-compose.dev.yml restart web Run some tests: docker-compose -f docker-compose.dev.yml exec -u web test bundle exec rspec
docker-compose -f docker-compose.dev.yml exec -u web test bundle exec rspec spec/controllers/shoutmsgs_controller_spec.rb`