@@ -10,6 +10,7 @@ includes:
1010 env : ./taskfiles/env/Taskfile.yml
1111 nodejs : ./taskfiles/nodejs/Taskfile.yml
1212 download : ./taskfiles/download/Taskfile.yml
13+ apache : ./taskfiles/apache/Taskfile.yml
1314
1415vars :
1516 # Variables avec valeurs par défaut depuis .env ou valeurs de fallback
@@ -58,30 +59,30 @@ tasks:
5859 desc : " Crée le dossier apps avec une installation WordPress via Bedrock"
5960 silent : true
6061 cmds :
61- - docker run --rm -v $(pwd):/var/www -w /var/www koromerzhin/php:8.4.3-apache composer create-project roots/bedrock apps --no-interaction
62+ - docker run --rm -v $(pwd):/var/www -w /var/www $(pwd)/apps:/var/www -w /var/www $(awk '/www:/ {f=1} f && /image:/ {print $2; exit}' {{.DOCKERCOMPOSEFILE}}) composer create-project roots/bedrock apps --no-interaction
6263
6364 wordpress:getapacheconf :
6465 desc : " Récupère la configuration Apache depuis l'image Docker"
6566 silent : true
6667 cmds :
6768 - rm -rf ./conf/apache2 || true
68- - docker create --name wordpress-php koromerzhin/php:8.4.3-apache
6969 - mkdir -p ./conf/apache2
70- - docker cp wordpress-php:/etc/apache2/sites-available/000-default.conf ./conf/apache2/000-default.conf
71- - docker cp wordpress-php:/etc/apache2/apache2.conf ./conf/apache2/apache2.conf
70+ - task docker:create CONTAINER_NAME=wordpress-php IMAGE_NAME=$(awk '/www:/ {f=1} f && /image:/ {print $2; exit}' {{.DOCKERCOMPOSEFILE}})
71+ - task : docker:getfile
72+ vars :
73+ CONTAINER_NAME : " wordpress-php"
74+ FILE_PATH : " /etc/apache2/sites-available/000-default.conf"
75+ DEST_PATH : " ./conf/apache2/000-default.conf"
76+ - task : docker:getfile
77+ vars :
78+ CONTAINER_NAME : " wordpress-php"
79+ FILE_PATH : " /etc/apache2/apache2.conf"
80+ DEST_PATH : " ./conf/apache2/apache2.conf"
7281 - docker rm -f wordpress-php
73-
74- - sed -ri -e 's|\$\{APACHE_DOCUMENT_ROOT\}|/var/www/web|g' ./conf/apache2/000-default.conf
75- - sed -ri -e 's|#ServerName www.example.com|ServerName {{.SERVERNAME}}|g' ./conf/apache2/000-default.conf
76- - sed -ri -e 's|\$\{APACHE_DOCUMENT_ROOT\}|/var/www/web|g' ./conf/apache2/apache2.conf
77- - |
78- sed -i '/^# Global configuration/a\
79- #\
80- # ServerName: Set the servers fully qualified domain name globally\
81- # This suppresses the warning about not being able to reliably determine\
82- # the servers fully qualified domain name\
83- #\
84- ServerName {{.SERVERNAME}}' ./conf/apache2/apache2.conf
82+ - task : apache:updateconfig
83+ vars :
84+ SERVERNAME : " {{.SERVERNAME}}"
85+ APACHE_DOCUMENT_ROOT : " /var/www/web"
8586
8687 wordpress:copysql :
8788 desc : " Copie le fichier SQL de dump dans le dossier wordpress"
@@ -149,7 +150,7 @@ tasks:
149150 SERVICE_NAME : " www"
150151
151152 wordpress:cmd-exec :
152- desc : " Affiche les informations Symfony "
153+ desc : " Affiche les informations wordpress "
153154 silent : true
154155 vars :
155156 INTERACTIVE : ' {{.INTERACTIVE | default "true"}}'
0 commit comments