Created
December 26, 2019 06:35
-
-
Save stnet253/b1a37f7246d47fe7d632386a6efe1430 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
set +e | |
if [ "$(podman pod ps | grep mkdev-dev | wc -l)" == "0" ] ; then | |
echo "> > > Starting PostgreSQL, Redis and Mattermost" | |
podman play kube pod.yaml | |
else | |
echo "Development pod is already running. Re-create it? Y/N" | |
read input | |
if [ $input == "Y" ] ; then | |
podman pod rm mkdev-dev -f | |
podman play kube pod.yaml | |
else | |
echo "Leaving bootstrap process." | |
exit 0 | |
fi | |
fi | |
echo "> > > Waiting for PostgreSQL to start" | |
until podman exec postgres psql -U postgres -c '\list' | |
do | |
echo "> > > > > > PostgreSQL is not ready yet" | |
sleep 1 | |
done | |
podman exec -u postgres postgres psql -U postgres -d template1 -c 'create extension hstore;' | |
echo "> > > Creating development IM database" | |
until podman exec -u postgres postgres createdb mattermost; do sleep 1; done | |
echo "> > > Creating test IM database" | |
until podman exec -u postgres postgres createdb mattermost_test; do sleep 1; done | |
echo "> > > Creating and seeding the database" | |
./script/setup.sh | |
./script/exec.sh 'bundle exec rails db:create db:migrate db:test:prepare' | |
./script/seed.sh | |
echo "> > > Attempting to start the app" | |
./script/run.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment