-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
98 lines (67 loc) · 3.47 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
.PHONY: ssh
ssh:
docker compose exec main bash
.PHONY: provision
provision: provision/drall provision/drupal
.PHONY: provision/drupal
provision/drupal:
mkdir -p /opt/drupal
cp /opt/drall/.docker/main/composer.json /opt/drupal/ || echo "Skipping drupal/composer.json"
rm -f /opt/drupal/composer.lock
composer --working-dir=/opt/drupal install --no-progress
cp -r /opt/drall/.docker/main/drush /opt/drupal/ || echo "Skipping drush directory."
cp -r /opt/drall/.docker/main/sites /opt/drupal/web/ || echo "Skipping sites directory."
mkdir -p /opt/drupal/web/sites/default
mkdir -p /opt/drupal/web/sites/donnie
mkdir -p /opt/drupal/web/sites/leo
mkdir -p /opt/drupal/web/sites/mikey
mkdir -p /opt/drupal/web/sites/ralph
cp /opt/drupal/web/sites/default/default.settings.php /opt/drupal/web/sites/default/settings.php
cp /opt/drupal/web/sites/default/default.settings.php /opt/drupal/web/sites/donnie/settings.php
cp /opt/drupal/web/sites/default/default.settings.php /opt/drupal/web/sites/leo/settings.php
cp /opt/drupal/web/sites/default/default.settings.php /opt/drupal/web/sites/mikey/settings.php
cp /opt/drupal/web/sites/default/default.settings.php /opt/drupal/web/sites/ralph/settings.php
@echo 'Drupal databases can be provisioned with: make provision/drupal/database'
.PHONY: provision/drupal/database
provision/drupal/database:
rm -f web/sites/*/settings.php
drush site:install -y minimal --db-url="mysql://drupal:drupal@database:3306/tmnt" --uri=default --account-name=tmnt-root --account-mail=tmnt@localhost --account-pass=cowabunga --site-name=TMNT
chown -R www-data:www-data web/sites/default
drush site:install -y minimal --sites-subdir=donnie --db-url="mysql://drupal:drupal@database:3306/donnie" --uri=donnie --account-name=tmnt-root --account-mail=tmnt@localhost --account-pass=cowabunga --site-name=Donatello
chown -R www-data:www-data web/sites/donnie
drush site:install -y minimal --sites-subdir=leo --db-url="mysql://drupal:drupal@database:3306/leo" --uri=leo --account-name=tmnt-root --account-mail=tmnt@localhost --account-pass=cowabunga --site-name=Leonardo
chown -R www-data:www-data web/sites/leo
drush site:install -y minimal --sites-subdir=mikey --db-url="mysql://drupal:drupal@database:3306/mikey" --uri=mikey --account-name=tmnt-root --account-mail=tmnt@localhost --account-pass=cowabunga --site-name=Michaelangelo
chown -R www-data:www-data web/sites/mikey
drush site:install -y minimal --sites-subdir=ralph --db-url="mysql://drupal:drupal@database:3306/ralph" --uri=ralph --account-name=tmnt-root --account-mail=tmnt@localhost --account-pass=cowabunga --site-name=Raphael
chown -R www-data:www-data web/sites/ralph
.PHONY: provision/drall
provision/drall:
composer install --working-dir=/opt/drall --no-progress
# The GitHub Action shivammathur/setup-php@v2 gives higher priority to
# the executables present in /opt/drall/vendor/bin. Thus, we remove
# Drush from this directory to force /opt/drupal/vendor/bin/drush.
rm -f /opt/drall/vendor/bin/drush
.PHONY: coverage-report/text
coverage-report/text:
cat /opt/drall/.coverage/text
.PHONY: coverage-report/html
coverage-report/html:
open .coverage/html/dashboard.html
.PHONY: lint
lint:
composer --working-dir=/opt/drall run lint
.PHONY: test
test:
DRALL_ENVIRONMENT=test XDEBUG_MODE=coverage composer --working-dir=/opt/drall run test
.PHONY: info
info:
@cd /opt/drupal
which php
@php --version
which composer
@composer --version
which drush
@drush --version
which drall
@drall --version