2020-03-15 18:31:46 +00:00
# Development
2020-03-18 19:11:10 +00:00
Install instructions in INSTALL.md
2020-03-22 12:49:27 +00:00
## Startup
Just run and open http://localhost:4000/
docker-compose -f docker-compose.dev.yml up`
## Tips
2020-03-21 20:32:48 +00:00
1. Everything should be running on containers.
1. 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.
1. 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.
2020-03-23 03:24:44 +00:00
2020-03-21 20:32:48 +00:00
sudo echo `docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ensl_dev_db` db >> /etc/hosts
2020-03-23 03:24:44 +00:00
2020-03-22 12:49:27 +00:00
1. VS Code and RubyMine are great IDE's/editors.
2020-03-28 20:39:41 +00:00
1. To run VS Code plugin Ruby Test Explorer in docker container you need to create path to custom path, copy the formatter and it whines about
and it still fails a bit. https://github.com/connorshea/vscode-ruby-test-adapter/issues/21
2020-03-22 13:24:57 +00:00
1. Do not commit too much without testing. Also keep commits small for documentation and reversability issues.
2020-03-25 23:34:52 +00:00
1. You need to rebuild the docker image when you change gems.
2020-03-15 18:31:46 +00:00
2020-03-22 12:49:27 +00:00
## Best practices
2020-03-22 13:24:57 +00:00
1. https://nvie.com/posts/a-successful-git-branching-model/
2020-03-22 12:49:27 +00:00
1. https://github.com/rubocop-hq/ruby-style-guide
1. https://rails-bestpractices.com/
1. http://www.betterspecs.org/
1. https://github.com/rubocop-hq/rspec-style-guide
1. Run rubocop
2020-03-23 03:24:44 +00:00
## TODO issues for dev
1. Puma should be running (eg. spring), and if debugger is used it should be able to connect via docker-compose up
2020-03-25 01:47:54 +00:00
# Tags in code
FIXME, TODO, EXPLAIN, OBSOLETE
2020-03-23 03:24:44 +00:00
2020-03-22 12:49:27 +00:00
## Handy commands
2020-03-15 18:31:46 +00:00
2020-03-25 23:34:52 +00:00
Build or rebuild
2020-03-28 20:39:41 +00:00
2020-03-25 23:34:52 +00:00
docker-compose -f docker-compose.dev.yml build`
2020-03-22 17:44:09 +00:00
To get inside docker web+test containers:
2020-03-23 03:24:44 +00:00
2020-03-22 13:55:27 +00:00
docker-compose -f docker-compose.dev.yml exec -u root web /bin/bash`
2020-03-22 04:13:47 +00:00
docker-compose -f docker-compose.dev.yml exec -u web web /bin/bash`
2020-03-22 13:55:27 +00:00
docker-compose -f docker-compose.dev.yml exec -u root test /bin/bash`
2020-03-22 04:13:47 +00:00
docker-compose -f docker-compose.dev.yml exec -u web test /bin/bash`
2020-03-23 03:24:44 +00:00
2020-03-22 17:44:09 +00:00
Restart the web container
2020-03-23 03:24:44 +00:00
2020-03-22 04:13:47 +00:00
docker-compose -f docker-compose.dev.yml restart web`
2020-03-23 03:24:44 +00:00
2020-03-22 17:44:09 +00:00
Run some tests:
2020-03-23 03:24:44 +00:00
2020-03-22 04:13:47 +00:00
docker-compose -f docker-compose.dev.yml exec -u web test bundle exec rspec`
2020-03-22 17:44:09 +00:00
docker-compose -f docker-compose.dev.yml exec -u web test bundle exec rspec spec/controllers/shoutmsgs_controller_spec.rb`