forked from laminas/getlaminas.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.platform.app.yaml
98 lines (88 loc) · 2.66 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
name: getlaminas_org
type: php:8.3
size: S
disk: 256
build:
flavor: none
variables:
env:
NVM_VERSION: v0.40.1
NODE_VERSION: v22.8.0
dependencies:
nodejs:
gulp-cli: '~3.0.0'
mounts:
'data/cache':
source: local
source_path: data/cache
'public/share':
source: local
source_path: public/share
hooks:
build: |
set -e
echo "Setting up Node"
unset NPM_CONFIG_PREFIX
export NVM_DIR="$PLATFORM_APP_DIR/.nvm"
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$NVM_VERSION/install.sh | bash
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
echo "Installing platform.sh CLI"
curl -sS https://platform.sh/cli/installer | php
echo "- Installing asset dependencies"
(cd bootstrap ; npm install)
echo "- Building assets"
(cd bootstrap ; gulp deploy)
mv bootstrap/build/assets.json data/
mv bootstrap/build/css public/
mv bootstrap/build/js public/
echo "- Setting up configuration"
rm -f config/development.config.php config/autoload/*.local.php
mv config/autoload/local.php.dist config/autoload/local.php
echo "- Installing application dependencies"
composer install --no-ansi --no-dev --no-interaction --no-scripts --no-plugins --optimize-autoloader
mkdir -p var/blog/feeds
composer build
deploy: |
rm -f data/cache/config-cache.php
if [ ! -e data/cache/releases.rss ];then cp templates/releases.rss data/cache/ ;fi
./vendor/bin/laminas repository:generate-data "$PLATFORM_VARIABLES" | base64 --decode | jq '."REPO_TOKEN"'
crons:
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
generatedata:
# Refresh repository data every night at 2 am (UTC).
spec: '0 2 * * *'
commands :
start: |
if [ "$PLATFORM_BRANCH" = master ]; then
./vendor/bin/laminas repository:generate-data "$PLATFORM_VARIABLES" | base64 --decode | jq '."REPO_TOKEN"'
fi
shutdown_timeout: 20
web:
locations:
'/':
root: 'public'
passthru: '/index.php'
index:
- index.php
expires: -1
scripts: true
allow: false
rules:
\.(css|js|gif|jpe?g|png|ttf|eot|woff2?|otf|cast|mp4|json|html|ico|svg|asc|webmanifest)$:
allow: true
expires: 300s
headers:
Access-Control-Allow-Origin: "*"