TripleParity/docks-api

View on GitHub
scripts/docks-dev-start.sh

Summary

Maintainability
Test Coverage
#!/bin/sh

# Wait for postgresql to be functional
until PGPASSWORD=$POSTGRES_PASSWORD psql -h "$DOCKS_DB_ADDRESS" -U "postgres" -c '\q'; do
  >&2 echo "Postgres is unavailable - sleeping"
  sleep 1
done

# Test if the Docker socket file exists
if test -S "/var/run/docker.sock";
then
    echo "Found Docker socket file.";
else
    echo "Docker socket file not found. Please mount /var/run/docker.sock">&2;
    exit 1;
fi

npm install

# Run migrations
./node_modules/.bin/sequelize db:migrate

DEBUG=docks:* PORT=8080 npm start