Permalink
Browse files

further fix installation script/instructions

  • Loading branch information...
1 parent b03a994 commit 3416f2e67a8170eb5845aa8c161f416db3c11b29 Justine Tunney committed Nov 7, 2011
Showing with 11 additions and 6 deletions.
  1. +5 −4 README.rst
  2. +6 −2 mkows.sh
View
@@ -43,16 +43,17 @@ Define pseudo hostnames by putting this in ``/etc/hosts``::
Install dependencies::
- wget -qO- https://raw.github.com/jart/occupywallst/master/install_depends.sh | bash
+ wget -qO- https://raw.github.com/jart/occupywallst/master/install_depends.sh | sudo bash
Now we're going to run the install script to create a virtualenv,
install the project, create the database, load the database content,
and create a local settings file::
- export DEST='/opt'
- export REPO='git@github.com:$USER/occupywallst.git' # did you make your github fork yet?
+ export PROJ="ows"
+ export DEST="/opt"
+ export REPO="git@github.com:$USER/occupywallst.git" # did you make your github fork yet?
wget -qO- https://raw.github.com/jart/occupywallst/master/mkows.sh | bash
- cd /opt/occupywallst/occupywallst
+ cd /opt/ows/occupywallst
source ../bin/activate
Now we'll setup nginx as our webserver::
View
@@ -15,13 +15,16 @@
[ -z $REPO ] && REPO=$(git remote -v 2>/dev/null | grep ^origin | awk '{print $2}' | grep /occupywallst\.git$ | head -n 1)
[ -z $REPO ] && REPO='git://github.com/jart/occupywallst.git'
-cd $DEST
-
function pg_db_exists {
psql -Al | grep ^$1\| >/dev/null
return $?
}
+if pg_db_exists $DB; then
+ echo "database $DB already exists!" >&2
+ exit 1
+fi
+
if ! pg_db_exists template_postgis; then
echo 'Creating template_postgis database...'
createdb template_postgis || exit 1
@@ -32,6 +35,7 @@ if ! pg_db_exists template_postgis; then
fi
# create a virtualenv for our project
+cd $DEST || exit 1
virtualenv $PROJ || exit 1
cd $PROJ || exit 1
source bin/activate || exit 1

0 comments on commit 3416f2e

Please sign in to comment.