Skip to content

Instantly share code, notes, and snippets.

@thiennn
Created August 7, 2017 16:19
Show Gist options
  • Save thiennn/02b7dbdb199c65dfef45ea9fac2bc6c1 to your computer and use it in GitHub Desktop.
Save thiennn/02b7dbdb199c65dfef45ea9fac2bc6c1 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
if psql -h simpldb --username postgres -lqt | cut -d \| -f 1 | grep -qw simplcommerce; then
echo "simplcommerce database existed"
else
echo "create new database simplcommerce"
psql -h simpldb --username postgres -c "CREATE DATABASE simplcommerce WITH ENCODING 'UTF8'"
psql -h simpldb --username postgres -d simplcommerce -a -f /app/dbscript.sql
psql -h simpldb --username postgres -d simplcommerce -a -f /app/StaticData_Postgres.sql
fi
cd /app && dotnet SimplCommerce.WebHost.dll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment