forked from ezsystems/ezplatform-ee-demo
/
.platform.app.yaml
126 lines (112 loc) · 4.86 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
# This file describes an application. You can have multiple applications
# in the same project.
# Please see doc/platformsh/README.md and doc/platformsh/INSTALL.md
# NB: Clustered eZ Platform setups are not tested and are likely to have issues.
# The name of this app. Must be unique within a project.
name: app
# The type of the application to build.
type: php:7.1
build:
# "none" means we're running composer manually, see build hook
flavor: "none"
# The relationships of the application with services or other applications.
# The left-hand side is the name of the relationship as it will be exposed
# to the application in the PLATFORM_RELATIONSHIPS variable. The right-hand
# side is in the form `<service name>:<endpoint name>`.
relationships:
database: 'mysqldb:user'
# Uncomment if you want to store dfs tables in a separate database:
#dfs_database: 'mysqldb:dfs'
rediscache: 'rediscache:redis'
# If you wish to have a separate Redis instance for sessions, uncomment
# this relationship and the corresponding service in .platform/services.yaml
#redissession: 'redissession:redis'
variables:
#php:
# Example of setting php.ini config
#"display_errors": "On"
env:
# For enterprise cluster, disable Symfony Proxy & instead use Fastly Bundle available on eZ Platform Enterprise
#SYMFONY_HTTP_CACHE: 0
# Change this to dev if you want to run site & commands in dev
SYMFONY_ENV: prod
# Uncomment if you want to use DFS clustering:
#PLATFORMSH_DFS_NFS_PATH: 'dfsdata'
# The configuration of app when it is exposed to the web.
web:
locations:
"/":
# The public directory of the app, relative to its root.
root: "web"
# The front-controller script to send non-static requests to.
passthru: "/app.php"
# The number of seconds whitelisted (static) content should be cache
expires: 600
# The size of the persistent disk of the application (in MB).
disk: 2048
# The mounts that will be performed when the package is deployed.
mounts:
"/var/cache": "shared:files/cache"
"/var/logs": "shared:files/logs"
"/web/var": "shared:files/files"
# Might want to not mount this one, it will slow down sessions, if you need cluster use memcached/redis!
"/var/sessions": "shared:files/sessions"
"/src/AppBundle/MigrationVersions/References": "shared:files/src/AppBundle/MigrationVersions/References"
# Uncomment if you want to use DFS clustering:
#"/dfsdata": "shared:files/dfsdata"
# The hooks that will be performed when the package is deployed.
hooks:
# Build hook, done once before connected to services, disk is still writable here
build: |
set -e
if [ -z "$COMPOSER_KEY" ]; then
echo "The 'COMPOSER_KEY' project variable must be set."
exit 1
elif [ -z "$COMPOSER_PASSWORD" ]; then
echo "The 'COMPOSER_PASSWORD' project variable must be set."
exit 1
fi
if [ ! -z "$GITHUB_TOKEN" ] ; then
composer config -g github-oauth.github.com $GITHUB_TOKEN
echo "Setting Github token."
fi
composer config http-basic.updates.ez.no $COMPOSER_KEY $COMPOSER_PASSWORD
composer install --no-dev --prefer-dist --no-progress --no-interaction --optimize-autoloader
rm web/app_dev.php
. ./.env
if [ "$SYMFONY_ENV" = "dev" ] ; then
composer install --prefer-dist --no-progress --no-interaction --optimize-autoloader
else
composer install --no-dev --prefer-dist --no-progress --no-interaction --optimize-autoloader
fi
# Deploy hook, access to services & done once (per cluster, not per node), only mounts are writable at this point
deploy: |
set -e
. ./.env
if [ ! -f web/var/.platform.installed ]; then
php -d memory_limit=-1 bin/console ezplatform:install $INSTALL_EZ_INSTALL_TYPE
touch web/var/.platform.installed
fi
# As we are deploying code changes we need to clear any kind of code/system cache
rm -Rf var/cache/*/*.*
bin/console cache:clear
# Example of addtional deploy hooks if you use doctrine and/or kaliop migration bundle
##bin/console doctrine:migrations:migrate --no-interaction --allow-no-migration
##bin/console kaliop:migration:migrate --no-interaction --no-debug
# The configuration of scheduled execution.
# see http://symfony.com/doc/current/components/console/introduction.html
#crons:
# symfony:
# spec: "*/20 * * * *"
# cmd: "php bin/console ezpublish:cron:run"
runtime:
extensions:
- xsl
- imagick
- readline
- redis
#- apcu
#- name: 'blackfire'
# configuration:
# server_id: 'xxxx-xxx-xxx-xxx-xxxx'
# server_token: 'xxxx'