Last active
January 8, 2020 00:26
-
-
Save rjnienaber/f8a7db67d8373855a0a8e89465676464 to your computer and use it in GitHub Desktop.
hotsapi setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# bring up mysql service | |
docker-compose up -d mysql | |
while ! nc -z localhost 3306; do | |
sleep 0.1 # wait for 1/10 of the second before check again | |
done | |
# install composer dependencies locally because we are using local files instead of content dir from the container | |
docker-compose run --rm --entrypoint 'composer install' hotsapi | |
# run migrations | |
docker-compose run --rm artisan migrate:fresh --seed | |
# populate maps, heroes, talents tables | |
docker-compose run --rm artisan hotsapi:fetch-talents | |
docker-compose run --rm artisan hotsapi:fetch-translations | |
sudo chmod -R a+w bootstrap/cache/ | |
sudo chmod -R a+w storage | |
# run webserver, available at localhost:8080 | |
docker-compose up -d hotsapi | |
while ! curl --output /dev/null -s --head --fail http://localhost:8080; do | |
sleep 0.1 # wait for 1/10 of the second before check again | |
done | |
sleep 1 | |
# Look at logs | |
# docker-compose logs -f | |
# upload replays | |
# parse replays replays | |
docker-compose run --rm artisan hotsapi:parse & | |
PARSE_PID=$! | |
sleep 10 | |
kill $PARSE_PID | |
sleep 0.5 | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment