ipld-eth-server/entrypoint.sh

28 lines
768 B
Bash
Raw Normal View History

2020-03-23 18:05:39 +00:00
#!/bin/sh
2020-06-30 00:16:52 +00:00
# Runs the db migrations and starts the watcher services
2020-03-23 18:05:39 +00:00
# Construct the connection string for postgres
VDB_PG_CONNECT=postgresql://$DATABASE_USER:$DATABASE_PASSWORD@$DATABASE_HOSTNAME:$DATABASE_PORT/$DATABASE_NAME?sslmode=disable
# Run the DB migrations
echo "Connecting with: $VDB_PG_CONNECT"
echo "Running database migrations"
./goose -dir migrations/vulcanizedb postgres "$VDB_PG_CONNECT" up
rv=$?
if [ $rv != 0 ]; then
echo "Could not run migrations. Are the database details correct?"
exit 1
fi
2020-05-01 15:49:07 +00:00
echo "Beginning the ipld-eth-server process"
2020-03-25 20:14:48 +00:00
echo running: ./ipld-eth-server ${VDB_COMMAND} --config=config.toml
./ipld-eth-server ${VDB_COMMAND} --config=config.toml
2020-03-23 18:05:39 +00:00
rv=$?
if [ $rv != 0 ]; then
echo "ipld-eth-server startup failed"
2020-03-23 18:05:39 +00:00
exit 1
fi