⌚ OpenOpeningstijden main server application
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. CMD_PREFIX=bundle exec
  2. CONTAINER_NAME=hours_development
  3. TEST_FILES_PATTERN ?= **/*_test.rb
  4. # You want latexmk to *always* run, because make does not have all the info.
  5. # Also, include non-file targets in .PHONY so they are run regardless of any
  6. # file of the given name existing.
  7. .PHONY: all test lint clean setup ruby packages preprocess run
  8. # The first rule in a Makefile is the one executed by default ("make"). It
  9. # should always be the "all" rule, so that "make" and "make all" are identical.
  10. all: test lint
  11. db:
  12. make _docker-install || make _docker-start
  13. make _wait
  14. make _db-setup
  15. # CUSTOM BUILD RULES
  16. test: export APP_ENV=test
  17. test:
  18. $(CMD_PREFIX) ruby -I lib:test:. -e "Dir.glob('$(TEST_FILES_PATTERN)') { |f| require(f) }"
  19. lint:
  20. $(CMD_PREFIX) rubocop
  21. clean:
  22. docker stop hours_development
  23. docker rm hours_development
  24. run:
  25. $(CMD_PREFIX) foreman start
  26. import:
  27. osmium tags-filter /mnt/sda/OSM/netherlands-latest.osm.pbf n/amenity=cafe,bar,restaurant,biergarten,fast_food,food_court,ice_cream,pub n/shop n/amenity=bicycle_parking,parking,parking_entrance --output-format osm | osm2geojson | bin/sink
  28. _docker-start:
  29. @if [ -z $(docker ps --no-trunc | grep $(CONTAINER_NAME)) ]; then docker start $(CONTAINER_NAME); fi
  30. _db-setup:
  31. $(CMD_PREFIX) rake db:create
  32. $(CMD_PREFIX) rake db:event_store
  33. $(CMD_PREFIX) rake db:projections
  34. $(CMD_PREFIX) rake db:seed # TODO: don't run seeds on test
  35. _wait:
  36. sleep 5
  37. ##
  38. # Set up the project for building
  39. setup: _ruby _packages _docker-install
  40. _docker-install:
  41. docker run -p 5432:5432 --name $(CONTAINER_NAME) -e POSTGRES_PASSWORD=$(DB_PASSWORD) -d mdillon/postgis
  42. _ruby:
  43. bundle install
  44. _packages:
  45. sudo apt install ruby