-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathgeokrety-entrypoint.sh
executable file
·65 lines (48 loc) · 1.53 KB
/
geokrety-entrypoint.sh
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
#!/bin/bash -x
set -e
cat <<'EOF'
----------------------------------------------------------------
GeoKrety website help
=====================
Some administratives actions could be launched via `make`:
$ make check
$ make buckets
…
----------------------------------------------------------------
EOF
# first arg is `-f` or `--some-option`
if [ "$1" = 'docker-php-entrypoint' ]; then
# Generate and optimize autoloader
make composer-autoload
# Migrate database
while ! pg_isready -h ${GK_DB_HOST:-postgres}; do sleep 1; done
runuser -u www-data make phinx-migrate
# Force new assets to be generated
runuser -u www-data make clear-assets
# build templates
runuser -u www-data make compile-all-templates
# build translations
make build-translations
# give permission to webserver to write css files
chown -R www-data.www-data /var/www/geokrety/website/public/assets/compressed
rm -f /var/www/geokrety/website/public/assets/compressed/*.css
echo "DEBUG: Launch $@"
$@ --nodaemonize &
# Create buckets
make buckets
# build sitemap
if [ "x${GK_ENVIRONMENT:-}" == 'xprod' ]; then
runuser -u www-data make build-sitemap &
fi
set +x
echo "#############################"
echo "### GeoKrety.org is READY"
echo "### http://${GK_WEBSITE_FQDN:-nginx}:${GK_WEBSITE_PORT:-80}"
echo "#############################"
wait
else
exec "$@"
fi
echo "#############################"
echo "### END"
echo "#############################"