Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easy install. #886

Merged
merged 6 commits into from
Jan 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
blank:
@echo "Downloading ona core dependencies and running migrations for you (hopefully into a virtualenv)... \n (This will take a while, go grab a coffee or something.)\n\n"
python2 -m pip install -r requirements/makefile_dependencies.pip
python2 -m pip install -e .
python2 manage.py syncdb --noinput
python2 manage.py migrate
@echo "Start the app with \`python2 manage.py runserver --nothreading\`"
@echo "Downloading ona core dependencies and running migrations for you (hopefully into a virtualenv)... \n (This will take a while, go grab a coffee or something.)\n\n"
python2 -m pip install -r requirements/base.pip
python2 -m pip install -r requirements/dev.pip
python2 manage.py migrate
@echo "Start the app with \`python2 manage.py runserver --nothreading\`"
39 changes: 36 additions & 3 deletions install.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Ubuntu installation instructions
## Prepare Os
# Ubuntu installation instructions.
## Prepare OS
$ ./script/install/ubuntu

## Database setup

### In the base OS
Replace username and db name accordingly.

sudo su postgres -c "psql -c \"CREATE USER onadata WITH PASSWORD 'onadata';\""
Expand All @@ -11,6 +13,38 @@ Replace username and db name accordingly.
sudo su postgres -c "psql -d onadata -c \"CREATE EXTENSION IF NOT EXISTS postgis;\""
sudo su postgres -c "psql -d onadata -c \"CREATE EXTENSION IF NOT EXISTS postgis_topology;\""

### In Docker
These are just examples and you shouldn't run them as they are in production:
Use the Dockerfile in [onaio/docker-builds](https://github.com/onaio/docker-builds/tree/master/postgres) for postgres 9.6.0 with postgis 2.3.0.
```
$ mkdir ~/docker-images/postgres-9.6/
$ cd ~/docker-images/postgres-9.6
$ docker build -t postgres:9.6.0 .
```

To run it.

> This will be a persistent using ~/postgresql/data

```
$ mkdir ~/postgresql/data
$ docker run -e POSTGRES_PASSWORD=pass -p 5432:5432 --volume ~/postgresql/data:/var/lib/postgresql/data --name onadata -d postgres:9.6.0
```

Connect using psql with:
`psql -h localhost -p 5432 -U postgres`

In psql:
```
CREATE USER onadata WITH PASSWORD 'pass'
CREATE DATABASE onadata OWNER onadata
CONNECT onadata
CREATE EXTENSION IF NOT EXISTS postgis
CREATE EXTENSION IF NOT EXISTS postgis_topology;\""
```

From now onwards start your DB with `docker start onadata` provided you passed the name "onadata" to Docker's `--name` option.

## Get the code
git clone https://github.com/onaio/onadata.git

Expand Down Expand Up @@ -65,4 +99,3 @@ You may at this point start core with `$ python manage.py runserver --nothreadin
# remove default nginx server config
sudo unlink /etc/nginx/sites-enabled/default
sudo service nginx restart

5 changes: 0 additions & 5 deletions requirements/makefile_dependencies.pip

This file was deleted.