This repository was archived by the owner on Aug 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.symfony.cloud.yaml
More file actions
83 lines (65 loc) · 2.16 KB
/
.symfony.cloud.yaml
File metadata and controls
83 lines (65 loc) · 2.16 KB
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
name: beloop-web
type: php:7.3
runtime:
extensions:
- apcu
- mbstring
build:
flavor: none
web:
locations:
"/":
root: "web"
expires: 1h
passthru: "/app.php"
disk: 2048
mounts:
"/var": { source: local, source_path: var }
"/web/fonts": { source: local, source_path: web_fonts }
"/web/images": { source: local, source_path: web_images }
"/web/media": { source: local, source_path: web_media }
"/web/uploads": { source: local, source_path: web_uploads }
relationships:
database: "beloopdb:admin"
analytics: "beloopdb:analytics"
hooks:
build: |
set -x -e
curl -s https://get.symfony.com/cloud/configurator | (>&2 bash)
(>&2 symfony-build)
# Keep uploaded images and files
(>&2 mkdir -p tmp/web/fonts && mv web/fonts/* tmp/web/fonts)
(>&2 mkdir -p tmp/web/images && mv web/images/* tmp/web/images)
(>&2 mkdir -p tmp/web/media && mv web/media/* tmp/web/media)
(>&2 mkdir -p tmp/web/uploads && mv web/uploads/* tmp/web/uploads)
# Build production assets
(>&2 SYMFONY_ENV=prod bin/console assetic:dump --env=prod --no-debug)
# Optimize Composer Autoloader
(>&2 composer dump-autoload --no-dev --classmap-authoritative)
deploy: |
set -x -e
(>&2 symfony-deploy)
# Restore user uploaded images
(>&2 mkdir -p web/fonts)
(>&2 cp -R tmp/web/fonts/* web/fonts/)
(>&2 mkdir -p web/images)
(>&2 cp -R tmp/web/images/* web/images/)
(>&2 mkdir -p web/media)
(>&2 cp -R tmp/web/media/* web/media/)
(>&2 mkdir -p web/uploads)
(>&2 cp -R tmp/web/uploads/* web/uploads/)
timezone: Europe/Paris
crons:
clean_prod_cache:
# every 15 minutes
spec: 15 * * * *
cmd: |
rm -rf var/cache/prod/
renewcert:
# Force a redeploy at 4 am (UTC) on the 1st and 15th of every month.
# for the master branch, aka production
spec: '0 4 1,15 * *'
cmd: |
if [ "$SYMFONY_BRANCH" = master ]; then
croncape symfony redeploy --no-wait
fi