-
Notifications
You must be signed in to change notification settings - Fork 0
/
.platform.app.yaml
234 lines (230 loc) · 8.84 KB
/
.platform.app.yaml
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
#############################################################################
### --== IMPORTANT ==-- ###
#############################################################################
# If you require changes to this file you must edit the file within the #
# original repository.Any changes here will be overwritten when the project #
# is built. #
#############################################################################
name: unity_svr_2
type: 'php:8.3'
dependencies:
php:
composer/composer: ^2
runtime:
extensions:
- apcu
- redis
- blackfire
disk: 30720
mounts:
/web/files:
source: local
source_path: files
/tmp:
source: local
source_path: tmp
/private:
source: local
source_path: private
/.drush:
source: local
source_path: drush
/drush-backups:
source: local
source_path: drush-backups
/.console:
source: local
source_path: console
/log:
source: local
source_path: log
/web/.well-known:
source: local
source_path: well-known
build:
flavor: composer
hooks:
build: |
set -e
echo "Update robots.txt with Unity customisations"
cp -f web/robots_unity.txt web/robots.txt
post_deploy: |
set -e
# Save the Fastly service value and overwrite with a dummy one in order to break
# the connection to Fastly, otherwise any cache clear of any site will purge the
# entire Fastly cache - we don't want this to happen as we'd like Fastly to continue
# serving the sites to anonymous users during a release.
echo "***** Breaking connection to Fastly ******"
temp=$FASTLY_API_SERVICE
export FASTLY_API_SERVICE=dummyservice
# For each multi site - run db-updates and import config.
for site in mentalhealthchampionni publicappointmentsni ircommission imtac nicertoffice victimspaymentsboard hiaredressni cvocni nijac communityrelations sentencereview nicybersecuritycentre ppsni cosicani
do
result=$(drush -l $site st | grep "Drupal bootstrap : Successful" | awk {'print $4'})
if [ "$result" = "Successful" ]; then
# Any properly configured Unity site will have the unity_common module installed.
result2=$(drush -l $site pml | grep "unity_common" | awk {'print $5'})
if [ "$result2" = "Enabled" ]; then
echo "****** $site deployment ******"
cd /app/web/sites/$site
# Disable Fastly logging
drush -l $site disable-fastly-logging
# Readonlymode module should be installed on all sites,
# but we'll just make sure.
drush en readonlymode -l $site -y
# Set site to readonly just in case editors are logged on.
drush -l $site cset readonlymode.settings enabled 1 -y
drush -l $site -y cache-rebuild
drush -l $site -y updatedb
drush -l $site -y config-import
# Clear up any erroneous redirects
drush -l $site delete-redirects
# Import blocks and taxonomies
drush -l $site import-all-if-installed safe
if [ "$PLATFORM_ENVIRONMENT_TYPE" = production ]; then
# Disable QA logons
drush -l $site bulk_update_qa_accounts disable
else
# Enable QA logons
drush -l $site bulk_update_qa_accounts enable
fi
# Turn off readonly mode.
drush -l $site cset readonlymode.settings enabled 0 -y
else
echo "****** Skipping $site as not fully installed ******"
echo ""
fi
else
echo "****** Skipping $site as there is no database ******"
echo ""
fi
done
# Reconnect to Fastly
echo "***** Reinstate connection to Fastly ******"
export FASTLY_API_SERVICE=$temp
# For each multi site - clear cache (including Fastly cache)
for site in mentalhealthchampionni publicappointmentsni ircommission imtac nicertoffice victimspaymentsboard hiaredressni cvocni nijac communityrelations sentencereview nicybersecuritycentre ppsni cosicani
do
result=$(drush -l $site st | grep "Drupal bootstrap : Successful" | awk {'print $4'})
if [ "$result" = "Successful" ]; then
# Any properly configured Unity site will have the unity_common module installed.
result2=$(drush -l $site pml | grep "unity_common" | awk {'print $5'})
if [ "$result2" = "Enabled" ]; then
echo "****** $site cache clear ******"
cd /app/web/sites/$site
drush -l $site -y cache-rebuild
# Enable Fastly logging
drush -l $site enable-fastly-logging
fi
fi
done
web:
locations:
/:
root: web
expires: 5m
passthru: /index.php
allow: false
rules:
'\.(jpe?g|png|gif|svgz?|css|js|map|ico|bmp|eot|woff2?|otf|ttf)$':
allow: true
^/robots\.txt$:
allow: true
^/sitemap\.xml$:
allow: true
^\/sites\/.+\/themes\/.+\/images\/favicons\/.+\.webmanifest$:
allow: true
expires: 2w
^/\.well-known/security\.txt$:
allow: true
^/sites/sites\.php$:
scripts: false
'^/sites/[^/]+/settings.*?\.php$':
scripts: false
/files:
allow: true
expires: 1d
passthru: /index.php
root: web/files
scripts: false
rules:
^/sites/default/files/(css|js):
expires: 2w
relationships:
redis: 'redis:redis'
mentalhealthchampionni: 'db:mentalhealthchampionni'
mentalhealthchampionni_solr: 'solr_8_11:mentalhealthchampionni'
publicappointmentsni: 'db:publicappointmentsni'
publicappointmentsni_solr: 'solr_8_11:publicappointmentsni'
ircommission: 'db:ircommission'
ircommission_solr: 'solr_8_11:ircommission'
imtac: 'db:imtac'
imtac_solr: 'solr_8_11:imtac'
nicertoffice: 'db:nicertoffice'
nicertoffice_solr: 'solr_8_11:nicertoffice'
victimspaymentsboard: 'db:victimspaymentsboard'
victimspaymentsboard_solr: 'solr_8_11:victimspaymentsboard'
hiaredressni: 'db:hiaredressni'
hiaredressni_solr: 'solr_8_11:hiaredressni'
cvocni: 'db:cvocni'
cvocni_solr: 'solr_8_11:cvocni'
nijac: 'db:nijac'
nijac_solr: 'solr_8_11:nijac'
communityrelations: 'db:communityrelations'
communityrelations_solr: 'solr_8_11:communityrelations'
sentencereview: 'db:sentencereview'
sentencereview_solr: 'solr_8_11:sentencereview'
nicybersecuritycentre: 'db:nicybersecuritycentre'
nicybersecuritycentre_solr: 'solr_8_11:nicybersecuritycentre'
ppsni: 'db:ppsni'
ppsni_solr: 'solr_8_11:ppsni'
cosicani: 'db:cosicani'
cosicani_solr: 'solr_8_11:cosicani'
crons:
mentalhealthchampionni:
spec: '10 * * * *'
cmd: 'cd web/sites/mentalhealthchampionni ; drush core-cron'
logging:
spec: '*/5 * * * *'
commands:
start: '/bin/bash /app/cronjob.sh'
shutdown_timeout: 290
publicappointmentsni:
spec: '10 * * * *'
cmd: 'cd web/sites/publicappointmentsni ; drush core-cron'
ircommission:
spec: '10 * * * *'
cmd: 'cd web/sites/ircommission ; drush core-cron'
imtac:
spec: '10 * * * *'
cmd: 'cd web/sites/imtac ; drush core-cron'
nicertoffice:
spec: '10 * * * *'
cmd: 'cd web/sites/nicertoffice ; drush core-cron'
victimspaymentsboard:
spec: '10 * * * *'
cmd: 'cd web/sites/victimspaymentsboard ; drush core-cron'
hiaredressni:
spec: '10 * * * *'
cmd: 'cd web/sites/hiaredressni ; drush core-cron'
cvocni:
spec: '10 * * * *'
cmd: 'cd web/sites/cvocni ; drush core-cron'
nijac:
spec: '10 * * * *'
cmd: 'cd web/sites/nijac ; drush core-cron'
communityrelations:
spec: '10 * * * *'
cmd: 'cd web/sites/communityrelations ; drush core-cron'
sentencereview:
spec: '10 * * * *'
cmd: 'cd web/sites/sentencereview ; drush core-cron'
nicybersecuritycentre:
spec: '10 * * * *'
cmd: 'cd web/sites/nicybersecuritycentre ; drush core-cron'
ppsni:
spec: '10 * * * *'
cmd: 'cd web/sites/ppsni ; drush core-cron'
cosicani:
spec: '10 * * * *'
cmd: 'cd web/sites/cosicani ; drush core-cron'