Skip to content

Instantly share code, notes, and snippets.

@olkeene
Last active February 7, 2018 16:14
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save olkeene/3bdd6c05ffc688f762bca86e5af723d6 to your computer and use it in GitHub Desktop.
Save olkeene/3bdd6c05ffc688f762bca86e5af723d6 to your computer and use it in GitHub Desktop.
#!/bin/bash
bundle check || bundle install --jobs 4 --retry 5
pids=( server.pid realtime_updater.pid )
for file in "${pids[@]}"
do
path="tmp/pids/$file"
if [ -f $path ]; then
rm $path
fi
done
./bin/wait-for-mysql.sh
echo "[INFO] Running in app: $@"
exec "$@"
#!/bin/bash
echo "[INFO] Waiting for mysql"
until mysql -h"$MYSQL_HOST" -P3306 -u"$MYSQL_ROOT_USER" -p"$MYSQL_ROOT_PASSWORD" -e 'show databases;'; do
>&2 printf "."
sleep 1
done
echo "[INFO] Mysql ready"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment