cerebrate/docker/entrypoint.sh

29 lines
529 B
Bash
Raw Normal View History

2021-10-25 15:46:47 +02:00
#!/bin/sh
set -e
run_all_migrations() {
./bin/cake migrations migrate
./bin/cake migrations migrate -p tags
./bin/cake migrations migrate -p ADmad/SocialAuth
}
2021-12-17 13:20:02 +01:00
delete_model_cache() {
2021-12-17 14:07:07 +01:00
echo >&2 "Deleting cakephp cache..."
2021-12-17 13:20:02 +01:00
rm -rf ./tmp/cache/models/*
rm -rf ./tmp/cache/persistent/*
}
delete_model_cache
2021-10-25 15:46:47 +02:00
# waiting for DB to come up
for try in 1 2 3 4 5 6; do
echo >&2 "migration - attempt $try"
run_all_migrations && break || true
sleep 5
[ "$try" = "6" ] && exit 1
done
exec /usr/local/bin/apache2-foreground "$@"