-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
173 lines (122 loc) · 3.68 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
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
163
164
165
166
167
168
169
170
171
172
173
ENVIRONMENT?=docker
DRUSH_ARGS?=-y --nocolor
HOST=php
SOLR_HOST=solr
COMMAND=/bin/bash
#
# Key targets
#
# Shortcut for make install, make build and make start
default: bootstrap install build start
# Bootstrap Deeson Drupal build framework
bootstrap:
./scripts/bootstrap-build-framework.sh
# Install dependencies
install:
./scripts/make/install.sh
# Build all static assets
build:
./scripts/make/build.sh
# Start Docker Compose services but assume dependencies and build has already taken place
start:
@echo Bringing docker containers up
docker-compose up -d
docker-compose ps
# Run all tests
test:
./scripts/make/test.sh
# Update Drupal
update:
./scripts/make/update.sh ${ENVIRONMENT} ${DRUSH_ARGS}
# Set the alias required by Xdebug
xdebug:
sudo ifconfig lo0 alias 10.254.254.254
#
# Targets for interacting with Docker Compose
#
# Stop docker
stop:
docker-compose down --remove-orphans
# Restart docker
restart: stop start
# Connect to the shell on a docker host, defaults to HOST=php COMMAND=/bin/bash
# Usage: make shell HOST=[service name] COMMAND=[command]
shell:
docker-compose exec $(HOST) $(COMMAND)
#
# Targets for orchestrating project build
#
# Initialise Apache Solr core in service container for Apache Solr (without Search API).
build-solr:
make shell HOST=$(SOLR_HOST) COMMAND='make core=core1 config_set=apachesolr -f /usr/local/bin/actions.mk'
# Initialise Apache Solr core in service container for Apache Solr (via Search API).
build-searchapi-solr:
make shell HOST=$(SOLR_HOST) COMMAND='make core=core1 -f /usr/local/bin/actions.mk'
#
# Targets for cleaning project build artefacts
#
# Remove everything that's re-buildable. Running make build will reverse this.
clean: clean-drupal clean-frontend
# Remove NodeJS modules required by front-end
clean-node:
./scripts/make/clean-node.sh
# Remove all front-end build artefacts including NodeJS modules
clean-frontend: clean-node
./scripts/make/clean-frontend.sh
# Remove dependencies managed by Composer
clean-composer:
./scripts/make/clean-composer.sh
# Remove Drupal dependencies managed by Drush Make including Composer dependencies
clean-drupal: clean-composer
./scripts/make/clean-drupal.sh
#
# Targets for Bitbucket Pipelines
#
# Bootstrap scripts/make directory
pipelines-bootstrap:
./scripts/bootstrap-build-framework.sh
# Build Drupal under Pipelnes.
pipelines-build-drupal:
./scripts/make/install-drupal.sh
# Build the frontend resources and copy them into the docroot under Pipelines
pipelines-build-frontend:
./scripts/make/build-frontend.sh
# Relay to hosting platform provided Git repository under Pipelines.
pipelines-deploy:
/opt/ci-tools/deployer.sh
# Run all the tests under Pipelines.
pipelines-test: pipelines-test-all
# Run only the coding standards tests under Pipelines.
pipelines-test-standards:
./scripts/make/test/run-test.sh --standards
# Run only the unit tests under Pipelines.
pipelines-test-unit:
./scripts/make/test/run-test.sh --unit
# Run only the behat tests under Pipelines.
pipelines-test-behat:
./scripts/make/test/run-test.sh --behat
# Run all the tests under Pipelines.
pipelines-test-all:
./scripts/make/test/run-test.sh --all
#
# Targets for interacting with Docker Compose
#
# Run all the tests.
test: test-all
# Run only the coding standards tests.
test-standards:
./scripts/make/test/run-tests.sh --standards
# Run only the unit tests.
test-unit:
./scripts/make/test/run-tests.sh --unit
# Run only the behat tests.
test-behat:
./scripts/make/test/run-tests.sh --behat
# Run all the tests.
test-all:
./scripts/make/test/run-tests.sh --all
#
# Targets specific to the project
#
# Note: Do not forget to precede the target definition with a comment explaining what it does!
#