-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.platform.app.yaml
168 lines (164 loc) · 5.8 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
#############################################################################
### --== 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: corp_lite
type: 'php:8.3'
dependencies:
php:
composer/composer: ^2
runtime:
extensions:
- apcu
- redis
- blackfire
disk: 25000
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
build:
flavor: composer
hooks:
build: |
set -e
echo "Update robots.txt with Corp Lite customisations"
cp -f web/robots_custom.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 nisra afbini hseni etini northsouthministerialcouncil
do
result=$(drush -l $site st | grep "Drupal bootstrap : Successful" | awk {'print $4'})
if [ "$result" = "Successful" ]; then
echo "****** $site deployment ******"
cd /app/web/sites/$site
# 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
# Import blocks and taxonomies
drush -l $site import-blocks --choice=safe
drush -l $site import-taxonomies --choice=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 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 nisra afbini hseni etini northsouthministerialcouncil
do
result=$(drush -l $site st | grep "Drupal bootstrap : Successful" | awk {'print $4'})
if [ "$result" = "Successful" ]; then
echo "****** $site cache clear ******"
cd /app/web/sites/$site
drush -l $site -y cache-rebuild
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
^/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'
nisra: 'db:nisra'
nisra_solr: 'solr_8_11:nisra'
afbini: 'db:afbini'
afbini_solr: 'solr_8_11:afbini'
hseni: 'db:hseni'
hseni_solr: 'solr_8_11:hseni'
etini: 'db:etini'
etini_solr: 'solr_8_11:etini'
northsouthministerialcouncil: 'db:northsouthministerialcouncil'
northsouthministerialcouncil_solr: 'solr_8_11:northsouthministerialcouncil'
crons:
nisra:
spec: '10 * * * *'
cmd: 'cd web/sites/nisra ; drush core-cron'
logging:
spec: '*/5 * * * *'
commands:
start: '/bin/bash /app/cronjob.sh'
shutdown_timeout: 290
afbini:
spec: '10 * * * *'
cmd: 'cd web/sites/afbini ; drush core-cron'
hseni:
spec: '10 * * * *'
cmd: 'cd web/sites/hseni ; drush core-cron'
etini:
spec: '10 * * * *'
cmd: 'cd web/sites/etini ; drush core-cron'
northsouthministerialcouncil:
spec: '10 * * * *'
cmd: 'cd web/sites/northsouthministerialcouncil ; drush core-cron'