Skip to content

Commit 72a4de5

Browse files
committed
Update taskfiles with apache update
1 parent d1cbd6f commit 72a4de5

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

Taskfile.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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

1415
vars:
1516
# Variables avec valeurs par défaut depuis .env ou valeurs de fallback
@@ -68,23 +69,23 @@ tasks:
6869
silent: true
6970
cmds:
7071
- rm -rf ./conf/apache2 || true
71-
- docker create --name symfony-php koromerzhin/php:8.4.3-apache-symfony
7272
- mkdir -p ./conf/apache2
73-
- docker cp symfony-php:/etc/apache2/sites-available/000-default.conf ./conf/apache2/000-default.conf
74-
- docker cp symfony-php:/etc/apache2/apache2.conf ./conf/apache2/apache2.conf
73+
- task docker:create CONTAINER_NAME=symfony-php IMAGE_NAME=$(awk '/www:/ {f=1} f && /image:/ {print $2; exit}' {{.DOCKERCOMPOSEFILE}})
74+
- task: docker:getfile
75+
vars:
76+
CONTAINER_NAME: "symfony-php"
77+
FILE_PATH: "/etc/apache2/sites-available/000-default.conf"
78+
DEST_PATH: "./conf/apache2/000-default.conf"
79+
- task: docker:getfile
80+
vars:
81+
CONTAINER_NAME: "symfony-php"
82+
FILE_PATH: "/etc/apache2/apache2.conf"
83+
DEST_PATH: "./conf/apache2/apache2.conf"
7584
- docker rm -f symfony-php
76-
77-
- sed -ri -e 's|\$\{APACHE_DOCUMENT_ROOT\}|/var/www/public|g' ./conf/apache2/000-default.conf
78-
- sed -ri -e 's|#ServerName www.example.com|ServerName {{.SERVERNAME}}|g' ./conf/apache2/000-default.conf
79-
- sed -ri -e 's|\$\{APACHE_DOCUMENT_ROOT\}|/var/www/public|g' ./conf/apache2/apache2.conf
80-
- |
81-
sed -i '/^# Global configuration/a\
82-
#\
83-
# ServerName: Set the servers fully qualified domain name globally\
84-
# This suppresses the warning about not being able to reliably determine\
85-
# the servers fully qualified domain name\
86-
#\
87-
ServerName {{.SERVERNAME}}' ./conf/apache2/apache2.conf
85+
- task: apache:updateconfig
86+
vars:
87+
SERVERNAME: "{{.SERVERNAME}}"
88+
APACHE_DOCUMENT_ROOT: "/var/www/public"
8889

8990
symfony:copysql:
9091
desc: "Copie le fichier SQL de dump dans le dossier symfony"
@@ -117,7 +118,7 @@ tasks:
117118
desc: "Installation initiale de Composer et des dépendances"
118119
silent: true
119120
cmds:
120-
- docker run --rm -v $(pwd)/apps:/var/www -w /var/www koromerzhin/php:8.4.3-apache-symfony symfony composer install
121+
- docker run --rm -v $(pwd)/apps:/var/www -w /var/www $(pwd)/apps:/var/www -w /var/www $(awk '/www:/ {f=1} f && /image:/ {print $2; exit}' {{.DOCKERCOMPOSEFILE}}) symfony composer install
121122

122123
symfony:waiting:
123124
desc: "Attend que les services soient opérationnels"
@@ -140,7 +141,7 @@ tasks:
140141
desc: "Crée un nouveau projet Symfony dans le dossier apps"
141142
silent: true
142143
cmds:
143-
- docker run --rm -v $(pwd):/var/www -w /var/www -e COMPOSER_MEMORY_LIMIT=512M -e HOME=/var/www --user $(id -u):$(id -g) koromerzhin/php:8.4.3-apache-symfony sh -c "git config --global user.name 'Symfony Project' && git config --global user.email 'symfony@example.com' && symfony new apps --version='{{.SYMFONYVERSION}}' --webapp"
144+
- docker run --rm -v $(pwd):/var/www -w /var/www -e COMPOSER_MEMORY_LIMIT=512M -e HOME=/var/www --user $(id -u):$(id -g) $(pwd)/apps:/var/www -w /var/www $(awk '/www:/ {f=1} f && /image:/ {print $2; exit}' {{.DOCKERCOMPOSEFILE}}) sh -c "git config --global user.name 'Symfony Project' && git config --global user.email 'symfony@example.com' && symfony new apps --version='{{.SYMFONYVERSION}}' --webapp"
144145
- rm -rf ./apps/.git
145146
- rm -rf ./.gitconfig
146147

0 commit comments

Comments
 (0)