forked from teamdeeson/d9-quickstart
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
162 lines (126 loc) · 3.27 KB
/
Makefile
File metadata and controls
162 lines (126 loc) · 3.27 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#
# Optionally include a .env file.
#
-include .env
#
# You can choose to not use Docker for local development by specifying the USE_DOCKER=0 environment variable in
# your project .env file. The default is to use Docker for local development.
#
USE_DOCKER ?= 1
#
# Ensure the local environment has the right binaries installed.
#
REQUIRED_BINS := php composer
$(foreach bin,$(REQUIRED_BINS),\
$(if $(shell command -v $(bin) 2> /dev/null),,$(error Please install `$(bin)`)))
#
# Default is what happens if you only type make.
#
default: install start build
#
# Bring in the external project dependencies.
#
install: .env
ifeq ("${USE_DOCKER}","1")
docker run --rm --interactive --tty --volume $(PWD):/var/www/html:delegated wodby/drupal-php:7.3-dev /bin/bash -c "composer global require hirak/prestissimo; composer install"
else
composer install
endif
#
# Update all Composer dependencies.
#
update:
ifeq ("${USE_DOCKER}","1")
docker run --rm --interactive --tty --volume $(PWD):/app --volume $(PWD)/.persist/composer:/tmp wodby/drupal-php:7.3-dev /bin/bash -c "composer global require hirak/prestissimo; composer update"
else
composer update
endif
#
# Start the local development server.
#
start:
ifeq ("${USE_DOCKER}","1")
@echo Bringing docker containers up
docker-compose up -d
docker-compose ps
else
./vendor/bin/drush runserver
endif
stop:
ifeq ("${USE_DOCKER}","1")
docker-compose down --remove-orphans
endif
restart: stop start
#
# Build stages: Setup and configure the application for the environment.
#
build: install-drupal
install-drupal:
ifeq ("${USE_DOCKER}","1")
@echo Waiting for db to be ready ...
@sleep 45
./drush.wrapper @docker cim --yes
./drush.wrapper @docker uli
else
./vendor/bin/drush si standard --yes
./vendor/bin/drush cim --yes
./vendor/bin/drush uli
endif
#
# Linting / testing / formatting.
#
lint:
@echo "TBC ..."
test:
@echo "TBC ..."
format:
@echo "TBC ..."
#
# Delete all non version controlled files to reset the project.
#
clean: stop
chmod -R +w docroot/sites/default
rm -rf docroot vendor
#
# Generate project symlinks and other disposable assets and wiring.
#
.env:
cp .env.example .env
public-file-store:
ifeq ("${USE_DOCKER}","1")
@test -d docroot/sites/default/files && rm -rf docroot/sites/default/files ||:
@ln -sfn /mnt/files/public docroot/sites/default/files
endif
docroot/sites/default/settings.php:
ln -s ../../../src/settings/settings.php docroot/sites/default/settings.php
docroot/modules/custom:
ln -s ../../src/modules $@
docroot/themes/custom:
ln -s ../../src/themes $@
docroot/profiles/custom:
ln -s ../../src/profiles $@
#
# Commands which get run from composer.json scripts section.
#
composer--post-install-cmd: composer--post-update-cmd
composer--post-update-cmd: docroot/sites/default/settings.php \
public-file-store \
docroot/modules/custom \
docroot/themes/custom;
#
# Helper CLI commands.
#
sql-cli:
ifeq ("${USE_DOCKER}","1")
@docker-compose exec mariadb mysql -udrupal -pdrupal drupal
else
@echo "You need to use whatever sqlite uses..."
endif
logs:
ifeq ("${USE_DOCKER}","1")
docker-compose logs -f
else
@echo "You need to use whatever sqlite uses..."
endif
xdebug:
sudo ifconfig lo0 alias 10.254.254.254