Commit 8844a712ab230b11ac3dcfd9e840e8a242be0713

Authored by Antonio Terceiro
1 parent 60cd6ee2

New HACKING file

Showing 1 changed file with 33 additions and 78 deletions   Show diff stats
HACKING
1 1 = Noosfero instructions for developers
2 2  
3   -This document provides useful information to those who want to help with
4   -Noosfero development.
  3 +== A work about your the development platform
5 4  
6   -== Requirements for development
  5 +These instructions are tested and known to work on Debian stable, which is the
  6 +system that the Noosfero core developers use to work on Noosfero.
7 7  
8   -First, install all requirements listed in INSTALL. Note that you do not need to
9   -follow all the steps described there, you only need to install the packages
10   -listed in the "Requirements" section.
  8 +If you want to use another OS, read "Instructions for other systems" below.
11 9  
12   -After installing the requirements listed in INSTALL, you need to install some
13   -packages be able to run Noosfero tests. On Debian GNU/Linux and Debian-based
14   -systems, you install them with the following command:
  10 +== Instructions for Debian stable
15 11  
16   - # apt-get install libtidy-ruby libhpricot-ruby libmocha-ruby imagemagick po4a xvfb libxml2-dev libxslt-dev
  12 +Download the source code:
17 13  
18   -On other systems, they may or may not be available through your regular package
19   -management system. Below are the links to their homepages.
  14 + $ git clone git://gitorious.org/noosfero/noosfero.git
  15 + $ cd noosfero
20 16  
21   -* Mocha: http://mocha.rubyforge.org/
22   -* Tidy: http://tidy.sourceforge.net/
23   -* Hpricot: http://github.com/whymirror/hpricot
24   -* Imagemagick: http://wwwimagemagick.org/
25   -* po4a: http://po4a.alioth.debian.org/
26   -* xvfb: http://packages.debian.org/lenny/xvfb
27   -* Libxml2: http://xmlsoft.org/
28   -* Libxslt: http://xmlsoft.org/xslt
  17 +Run the quick start script:
29 18  
30   -== Boostraping a development/test environment
  19 + $ ./script/quick-start
31 20  
32   -You can copy and paste the commands below into a terminal (please review the
33   -commands and make sure you understand what you are doing):
  21 +Now you can execute the development server with:
34 22  
35   - # checkout the code from repository
36   - git clone git://gitorious.org/noosfero/noosfero.git
37   - # enter the directory
38   - cd noosfero
39   - # copy a sample config file
40   - cp config/database.yml.sqlite3 config/database.yml
41   - # create tmp directory if it doesn't exist
42   - mkdir tmp
43   - # start Solr
44   - rake solr:start
45   - # create the development database
46   - rake db:schema:load
47   - # run pending migrations
48   - rake db:migrate
49   - # compile translations:
50   - rake makemo
51   - # create some test data:
52   - ./script/sample-data
53   - # install latest requirements for running tests
54   - RAILS_ENV=cucumber rake gems:install
55   - RAILS_ENV=test rake gems:install
56   - # run the automated test suite to make sure your environment is sane:
57   - rake test
  23 + $ ./script/development
58 24  
59   -You should now be ready to go. Issue the following command to start the Rails
60   -development server:
  25 +You will be able to access Noosfero at http://localhost:3000/
61 26  
62   - ./script/server
  27 +If you want to use a different port than 3000, pass `-p <PORT>` to
  28 +./script/development
63 29  
64   -The server will be available at http://localhost:3000/ . If you want to use
65   -another port than 3000, you can use the -p option of ./script/server:
  30 +== Instructions for other systems
66 31  
67   - ./script/server -p 9999
  32 +On other OS, you have 2 options:
68 33  
69   -The above command makes the server available at http://localhost:9999/
  34 +1) using a chroot or a VM with Debian stable (easier)
70 35  
71   -The sample-data data scripts creates two administrator users with login "ze" and
72   -password "test" and login "adminuser" and password "admin".
  36 +Use a chroot (http://wiki.debian.org/Schroot) or a Virtual Machine (e.g. with
  37 +VirtualBox) with a Debian stable system and follow the instructions above for
  38 +Debian stable.
73 39  
74   -Note that some operations, like generating image thumbnails, sending e-mails,
75   -etc, are done in background in the context of a service independent from the
76   -Rails application server. To have those tasks performed in a development
77   -environment, you must run the delayed_job server like this:
  40 +2) Installing dependencies on other OS (harder)
78 41  
79   - ./script/delayed_job run
  42 +If you want to setup a development environment in another OS, you can create a
  43 +file under script/install-dependencies/, called <OS>-<CODENAME>.sh, which
  44 +installed the dependencies for your system. With this script in place,
  45 +./script/quick-start will call it at the point of installing the required
  46 +packages for Noosfero development.
80 47  
81   -This will block your terminal. To stop the delayed_job server, hit Control-C.
  48 +You can check script/install-dependencies/debian-squeeze.sh to have an idea of
  49 +what kind of stuff that script has to do.
82 50  
83   -== Enabling exceptions notification
84   -
85   -By default, exception notifications are disabled in development environment. If
86   -you want to enable it then you need to change some files:
87   -
88   -1) Add in config/environments/development.rb:
89   - config.action_controller.consider_all_requests_local = false
90   -
91   -2) Add in app/controller/application.rb:
92   - local_addresses.clear
93   -
94   -3) Add in config/noosfero.yml at development section:
95   - exception_recipients: [admin@example.com]
96   -
97   -== Releasing and building Debian package
98   -
99   -See RELEASING file.
  51 +If you write such script for your own OS, *please* share it with us at the
  52 +development mailing list so that we can include it in the official repository.
  53 +This way other people using the same OS will have to put less effort to develop
  54 +Noosfero.
... ...