Makefile 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. buildnc_php_d9:
  20. 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) php_d9
  21. buildncnginx:
  22. 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) nginx
  23. downbuildup: down build up
  24. up:
  25. docker-compose up -d
  26. ps:
  27. docker-compose ps
  28. logs:
  29. docker-compose logs -f
  30. d9_maj_config: d9_crd d9_composer_install d9_updb d9_cim d9_sync_struct d9_cr d9_pag
  31. d9_crd:
  32. docker exec popsu-php_d9-1 /bin/bash -c "drush cache-clear drush"
  33. d9_composer_install:
  34. docker exec popsu-php_d9-1 /bin/bash -c "composer install --no-dev"
  35. d9_updb:
  36. docker exec popsu-php_d9-1 /bin/bash -c "drush updb -y"
  37. d9_cim:
  38. docker exec popsu-php_d9-1 /bin/bash -c "drush config-import -y"
  39. d9_sync_struct:
  40. docker exec popsu-php_d9-1 /bin/bash -c "drush im --choice safe && drush ib --choice full"
  41. d9_cr:
  42. docker exec popsu-php_d9-1 /bin/bash -c "drush cr"
  43. d9_pag:
  44. docker exec popsu-php_d9-1 /bin/bash -c "drush pag all canonical_entities:node && drush pag all canonical_entities:taxonomy_term"
  45. d9_restart:
  46. docker-compose restart php_d9
  47. down:
  48. docker-compose down
  49. exec_nginx:
  50. docker exec -it popsu-nginx-1 bash
  51. exec_php_d7:
  52. docker exec -it popsu-php_d7-1 bash
  53. exec_php_d9:
  54. docker exec -it popsu-php_d9-1 bash
  55. exec_mysql_d7:
  56. docker exec -it popsu-mysql_d7-1 bash
  57. exec_mysql_d9:
  58. docker exec -it popsu-mysql_d9-1 bash
  59. dump_d7_db:
  60. docker exec popsu-mysql_d7-1 sh -c 'exec mysqldump -uroot -ppopsu popsu-d7' > ./ressources/popsu-d7-$(DATE_NOW)-local.sql
  61. dump_d9_db:
  62. docker exec popsu-mysql_d9-1 sh -c 'exec mysqldump -uroot -ppopsu popsu-d9' > ./ressources/popsu-d9-$(DATE_NOW)-local.sql