Makefile 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #!/usr/bin/make
  2. SHELL = /bin/sh
  3. USER_UID := $(shell id -u)
  4. USER_UNAME := $(shell id -un)
  5. USER_GID := $(shell id -g)
  6. USER_GNAME := $(shell id -gn)
  7. DATE_NOW := $(shell date '+%Y-%m-%d_%H%M%S')
  8. export USER_UID
  9. export USER_UNAME
  10. export USER_GID
  11. export USER_GNAME
  12. # export DATE_NOW
  13. pull:
  14. docker-compose pull
  15. build:
  16. docker-compose build --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME)
  17. buildnc:
  18. docker-compose build --no-cache --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME)
  19. downbuildup: down build up
  20. up:
  21. docker-compose up -d
  22. ps:
  23. docker-compose ps
  24. logs:
  25. docker-compose logs -f
  26. maj_config: crd composer_install updb cim cac cr #pag
  27. crd:
  28. docker exec reha-php-1 /bin/bash -c "drush cache-clear drush"
  29. composer_install:
  30. docker exec reha-php-1 /bin/bash -c "composer install --no-dev"
  31. updb:
  32. docker exec reha-php-1 /bin/bash -c "drush updb -y"
  33. cim:
  34. docker exec reha-php-1 /bin/bash -c "drush config-import -y"
  35. cac:
  36. docker exec reha-php-1 /bin/bash -c "drush content_as_config:import block_content --style=safe && drush content_as_config:import menu_link_content --style=safe"
  37. cr:
  38. docker exec reha-php-1 /bin/bash -c "drush cr"
  39. pag:
  40. docker exec reha-php-1 /bin/bash -c "drush pag all canonical_entities:node && drush pag all canonical_entities:taxonomy_term"
  41. restart_nginx:
  42. docker-compose restart nginx
  43. restart_php:
  44. docker-compose restart php
  45. down:
  46. docker-compose down
  47. exec_nginx:
  48. docker exec -it reha-nginx-1 bash
  49. exec_php:
  50. docker exec -it reha-php-1 bash
  51. exec_mysql:
  52. docker exec -it reha-mysql-1 bash
  53. dump_db:
  54. docker exec reha-mysql-1 sh -c 'exec mariadb-dump -uroot -preha reha' > ./ressources/reha-$(DATE_NOW)-local.sql