⌚ OpenOpeningstijden main server application
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. CMD_PREFIX=bundle exec
  2. CONTAINER_NAME=hours_development
  3. include .env
  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: docker db-setup
  12. # CUSTOM BUILD RULES
  13. test:
  14. $(CMD_PREFIX) ruby -I lib:test:. -e "Dir.glob('**/*_test.rb') { |f| require(f) }"
  15. lint:
  16. $(CMD_PREFIX) rubocop
  17. clean:
  18. docker stop hours_development
  19. docker rm hours_development
  20. run:
  21. $(CMD_PREFIX) foreman start
  22. docker:
  23. @if [ -z $(docker ps --no-trunc | grep $(CONTAINER_NAME)) ]; then docker start $(CONTAINER_NAME); fi
  24. db-setup:
  25. $(CMD_PREFIX) rake db:create
  26. $(CMD_PREFIX) rake db:event_store
  27. $(CMD_PREFIX) rake db:projections
  28. ##
  29. # Set up the project for building
  30. setup: ruby packages docker-install
  31. docker-install:
  32. docker run -p 5432:5432 --name $(CONTAINER_NAME) -e POSTGRES_PASSWORD=$(DB_PASSWORD) -d mdillon/postgis
  33. ruby:
  34. bundle install
  35. packages:
  36. sudo apt install ruby