Mercurial > hg > soundsoftware-site
annotate deploy/provision.d/080-database-load.sh @ 1600:ed9c467ef922 dockerise
Add hggit extension
author | Chris Cannam |
---|---|
date | Wed, 23 Aug 2017 11:32:50 +0100 |
parents | 94669513c53c |
children | 5486a5848ad8 |
rev | line source |
---|---|
Chris@1577 | 1 #!/bin/bash |
Chris@1577 | 2 |
Chris@1577 | 3 set -e |
Chris@1577 | 4 |
Chris@1589 | 5 # Start the database and if a dump file is found, load it. The dump |
Chris@1589 | 6 # file is then deleted so that the db won't be overwritten on |
Chris@1589 | 7 # subsequent runs. (The original repo contains no dump file, so it |
Chris@1589 | 8 # should exist only if you have provided some data to load.) |
Chris@1589 | 9 |
Chris@1577 | 10 /etc/init.d/postgresql start |
Chris@1577 | 11 |
Chris@1577 | 12 cd /var/www/code |
Chris@1577 | 13 |
Chris@1577 | 14 if [ -f postgres-dumpall ]; then |
Chris@1577 | 15 chmod ugo+r postgres-dumpall |
Chris@1577 | 16 sudo -u postgres psql -f postgres-dumpall postgres |
Chris@1589 | 17 rm postgres-dumpall |
Chris@1577 | 18 fi |
Chris@1577 | 19 |