-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
executable file
·39 lines (31 loc) · 966 Bytes
/
run.sh
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
set -e
# Ensure the app's dependencies are installed
mix deps.get
# Prepare Dialyzer if the project has Dialyxer set up
if mix help dialyzer >/dev/null 2>&1
then
echo "\nFound Dialyxer: Setting up PLT..."
mix do deps.compile, dialyzer --plt
else
echo "\nNo Dialyxer config: Skipping setup..."
fi
# Install node modules
echo "\nInstalling nodejs modules..."
npm install
# Wait for Postgres to become available.
sleep 5 # TODO: poll for a connection instead of setting up a race condition
#until psql -h db -U "postgres" -c '\q' 2>/dev/null; do
#>&2 echo "Postgres is unavailable - sleeping"
#sleep 1
#done
echo "\nPostgres is available: continuing with database setup..."
# Potentially Set up the database
mix ecto.create
mix ecto.migrate
# Check that the installation was successful by running tests
echo "\nTesting the installation..."
mix test
# Start the phoenix web server
echo "\n Launching Phoenix web server..."
mix phoenix.server