-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.platform.app.yaml
91 lines (83 loc) · 2.15 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
# This file describes an application. You can have multiple applications
# in the same project.
#
# See https://docs.platform.sh/user_guide/reference/platform-app-yaml.html
name: 'app'
type: 'php:8.2'
disk: 2048
build:
flavor: composer
relationships:
database: 'mysqldb:mysql'
solr: 'solr:main'
# @see .platform/services.yaml for enabling the below.
# chrome: 'chrome:http'
dependencies:
php:
composer/composer: '^2'
"drush/drush": "^12.4"
# Remote debugging is possible by uncommenting the runtime config below.
#runtime:
# extensions:
# - xdebug
mounts:
'/docroot/sites/default/files': 'shared:files/files'
'/tmp': 'shared:files/tmp'
'/private': 'shared:files/private'
'/.drush': 'shared:files/.drush'
'/drush-backups': 'shared:files/drush-backups'
'/.console': 'shared:files/console'
hooks:
build: |
curl -sS https://platform.sh/cli/installer | php
deploy: |
cd docroot
drush -y updatedb
drush -y config-import
drush -y cache-rebuild
web:
locations:
'/':
root: 'docroot'
expires: -1
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/default/files':
allow: true
expires: 3M
passthru: '/index.php'
root: 'docroot/sites/default/files'
scripts: false
rules:
'^/sites/default/files/(css|js)':
expires: 3M
crons:
drupal:
# Run cron every 20 minutes
spec: '*/20 * * * *'
cmd: 'cd docroot ; drush core-cron'
drush-cr:
# Clear caches twice a day
spec: '0 7/12 * * *'
cmd: 'cd docroot ; drush cr'
snapshot:
# Take a snapshot automatically every night at 3 am (UTC).
spec: '0 3 * * *'
cmd: |
if [ "$PLATFORM_BRANCH" = master ]; then
platform snapshot:create --yes --no-wait
fi
renewcert:
# Force a redeploy at 8 am (UTC) on the 14th and 28th of every month.
spec: '0 8 14,28 * *'
cmd: |
if [ "$PLATFORM_BRANCH" = master ]; then
platform redeploy --yes --no-wait
fi