-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathkoel-init
More file actions
executable file
·25 lines (22 loc) · 1.25 KB
/
koel-init
File metadata and controls
executable file
·25 lines (22 loc) · 1.25 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
#!/bin/bash
if [[ ! -f /var/www/html/.env ]]; then
echo "No .env file found in /var/www/html. Make sure to mount a .env file to store the configuration. You can use the koel:init command (see https://github.com/koel/docker#the-koelinit-command) for a guided setup."
echo ""
echo "See https://github.com/koel/koel/blob/master/.env.example for an example .env file."
exit 0
fi
if [[ -z "${SKIP_INIT}" ]]; then
if [[ -z "${OPTIMIZE_CONFIG}" ]]; then
echo "Config not optimized. You can optimize the config with `OPTIMIZE_CONFIG`. Note that this will prevent config modifications from being applied until the container is restarted."
else
echo "Optimizing config..."
# clear before caching, in case this is a container reboot and it was already cached from before
php artisan config:clear
php artisan config:cache
fi
# Invoke the init script so database migrations run and the config is at least partially validated
echo "Running installer..."
php artisan koel:init --no-assets --no-interaction
else
echo "Initialization skipped. koel might not work properly if it is misconfigured or if the database is out of date. This should not be used outside of debugging or manual initial setups!"
fi