~elachuni/rnr-server/configglue-1.0

« back to all changes in this revision

Viewing changes to README

  • Committer: Tarmac
  • Author(s): Michael Nelson
  • Date: 2011-11-10 13:30:46 UTC
  • mfrom: (207.1.2 improve_readme)
  • Revision ID: tarmac@server-1567-20111110133046-60bn4oqcs5189lnk
[r=michael.nelson] Improve README for setting up developer environment.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
Setting up the development environment
3
3
======================================
4
4
 
5
 
You can simply use:
6
 
 
7
 
  $ fab bootstrap test
8
 
 
9
 
to setup and test your development environment. If you haven't used
10
 
pip before or setup its download cache, you may want to do the
11
 
following first so that you don't need to download eggs for each
12
 
branch or project that you work on:
 
5
This branch sets up its own development environment using fabric and
 
6
virtualenv. You can ensure all the required packages are installed on
 
7
your development machine with:
 
8
 
 
9
  $ sudo apt-get install fabric python-virtualenv postgresql-server-dev-9.1 python-dev unzip
 
10
 
 
11
(python-dev and postgresql-server-dev-9.1 are required for building
 
12
the psycopg driver on Oneiric).
 
13
 
 
14
To bootstrap your development environment:
 
15
  $ fab bootstrap
 
16
 
 
17
And to verify that all tests are passing in your development environment:
 
18
  $ fab test
 
19
 
 
20
If you haven't used pip before or setup its download cache, you may want to do
 
21
the following first so that you don't need to download eggs for each branch or
 
22
project that you work on:
13
23
 
14
24
  $ mkdir -p ~/.pip/cache
15
25
  $ echo -e "[global]\ndownload_cache = ~/.pip/cache" > ~/.pip/pip.conf
16
26
 
17
 
If you will also be testing against postgres, you'll also need
18
 
the postgres debversion package (for your version of postgres).
19
 
 
20
27
==================
21
28
Running the server
22
29
==================
77
84
    >>> response = api.submit_review(review=request)
78
85
 
79
86
 
 
87
====================================
 
88
Testing and developing with Postgres
 
89
====================================
 
90
 
 
91
Currently our production servers run postgresql-8.4 on lucid,
 
92
but until we provide a virtual machine or bootstrap an lx-container
 
93
matching our production OS, we need to satisfy dependencies for
 
94
a dev environment in Oneiric, which means using postgresql-9.1
 
95
(as the debversion plugin is only available for 9.1 in oneiric).
 
96
 
 
97
  $ sudo apt-get install postgresql-9.1 postgresql-9.1-debversion
 
98
 
 
99
then edit the postgres authentication file to allow trusted access
 
100
to the postgres user (note: obvious security risk for any net-facing
 
101
machine - if you're using a publicly accessible machine, then you should
 
102
know a more secure way of enabling access :P):
 
103
 
 
104
  $ sudo vim /etc/postgresql/9.1/main/pg_hba.conf
 
105
 
 
106
find the line that looks like:
 
107
 
 
108
{{{
 
109
# Database administrative login by Unix domain socket
 
110
local   all             postgres                                peer
 
111
}}}
 
112
 
 
113
and change peer to trust, save, then restart postgres with:
 
114
 
 
115
  $ sudo service postgresql restart
 
116
 
 
117
Finally, for postgres, we need to ensure that the rnr database
 
118
first exists:
 
119
 
 
120
  $ psql -U postgres
 
121
  postgres=# create database rnr;
 
122
  CREATE DATABASE
 
123
  postgres=# \q
 
124
 
 
125
You can now verify your setup with:
 
126
  $ fab test:pg=true
 
127
 
 
128
 
80
129
========================
81
130
Updating a remote server
82
131
========================