Skip to content

Commit e898f32

Browse files
committed
chore: add task to retrieve Apache configuration from Docker image and update CI deployment steps
1 parent e6ba28a commit e898f32

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ jobs:
8080
- name: Deploy containers
8181
run: |
8282
task drupal:getpull-image
83+
task drupal:getapacheconf
8384
task create:apps
8485
task drupal:deploy
8586
task drupal:waiting

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
.env
44
/install
55
docker-compose-*.yml
6-
!docker-compose-lampy.yml
6+
!docker-compose-lampy.yml
7+
/conf/apache2

Taskfile.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@ tasks:
4949
cmds:
5050
- task: default
5151

52+
drupal:getapacheconf:
53+
desc: "Récupère la configuration Apache depuis l'image Docker"
54+
silent: false
55+
cmds:
56+
- rm -rf ./conf/apache2 || true
57+
- docker create --name drupal-php koromerzhin/php:8.4.3-apache-symfony
58+
- docker cp drupal-php:/etc/apache2/ ./conf/apache2
59+
- docker rm -f drupal-php
60+
61+
- sed -ri -e "s!/var/www/html!${APACHE_DOCUMENT_ROOT}!g" ./conf/apache2/sites-available/*.conf
62+
- sed -ri -e "s!/var/www/!${APACHE_DOCUMENT_ROOT}!g" ./conf/apache2/apache2.conf
63+
- sed -ri -e "s!/var/www/!${APACHE_DOCUMENT_ROOT}!g" ./conf/apache2/conf-available/*
64+
5265
drupal:copysql:
5366
desc: "Copie le fichier SQL de dump dans le dossier drupal"
5467
silent: true
@@ -103,6 +116,7 @@ tasks:
103116
desc: "Exécute une commande dans un conteneur en cours d'exécution"
104117
cmds:
105118
- task: drupal:copysql
119+
- task: drupal:getapacheconf
106120
- task: drupal:getpull-image
107121
- task: drupal:deploy
108122
- task: drupal:waiting

docker-compose-lampy.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ services:
1717
- redis
1818
volumes:
1919
- ${PWD}/apps:/var/www/:rw
20+
- ${PWD}/conf/apache2:/etc/apache2/
2021
- ${PWD}/conf/php.ini-development://usr/local/etc/php/conf.d/php.ini
21-
environnement:
22-
- APACHE_DOCUMENT_ROOT=/var/www/web
2322
networks:
2423
- net
2524
- serverlampy

0 commit comments

Comments
 (0)