User Tools

Site Tools


project_management

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
project_management [2010/06/09 12:00]
172.26.14.218
— (current)
Line 1: Line 1:
-====== Project Management ====== 
  
-  * [[#subversion|Subversion]] - centralized version control for programming projects) 
-  * [[#trac|Trac]] - web-based code viewer, bug tracker, and ticketing system 
-  * [[#redmine|Redmine]] - web-based code viewer, bug tracker, and ticketing system 
- 
-====== Subversion ====== 
- 
-Subversion (SVN) uses a centralized model to manage software projects.  Collaborators check the source code out from the repository to their local development environments, make changes, then check code back in. 
- 
-The repository can be on the local machine or a remote server, as SVN supports several protocols (%%svn://%%, %%http://%% using Apache's mod_dav_svn module, %%file://%%, etc).. 
- 
-===== Install ===== 
-<code>$ sudo aptitude install subversion</code> 
-Configure Apache: 
- 
-===== Create a New Project ===== 
-==== On The Server ==== 
- 
-Create the project skeleton (the name isn't important, it is only a folder in the file system): 
-<code>$ sudo mkdir /tmp/myproject 
-$ sudo mkdir /tmp/myproject/{branches,tags,trunk}</code> 
- 
-Create the SVN repository, : 
-<code>$ sudo mkdir /mnt/repositories/myproject 
-$ sudo svnadmin create /mnt/repositories/myproject</code> 
- 
-Import the initial project skeleton: 
-<code>$ svn import /tmp/myproject/ file:///mnt/repositories/myproject/ -m "Initial import of project skeleton"</code> 
- 
-Clean up temp files and repository permissions. The repository needs ''www-data'' permissions because Apache will be serving our repository for us: 
-<code>$ sudo rm -rf /tmp/myproject 
-$ sudo find /mnt/repositories/myproject/ -type f -exec chmod 660 {} \; 
-$ sudo find /mnt/repositories/myproject/ -type d -exec chmod 2770 {} \; 
-$ sudo chown -R root.www-data /mnt/repositories/myproject/</code> 
- 
-Tell Apache to use ''/svn/myproject'' URLs with the dav_svn module, ''/etc/apache2/conf.d/svn.conf'': 
-<file><Location /svn/myproject> 
-    DAV svn  
-    SVNPath /mnt/repositories/myproject 
-    AuthzSVNAccessFile /mnt/repositories/authz_svn_access 
- 
-    AuthName "Microsoft Active Directory Authentication" 
-    AuthType Basic 
- 
-    PerlAuthenHandler Apache2::AuthenMSAD 
-    PerlSetVar MSADDomain ilri.cgiarad.org 
-    PerlSetVar MSADServer 172.26.0.218 
- 
-    # require any valid AD user to access the repo via Apache, 
-    # then use fine-grained controls in the AuthzSVNAccessFile 
-    # above. See: http://svnbook.red-bean.com/nightly/en/svn.serverconfig.pathbasedauthz.html#id646000 
-    require valid-user 
- 
-    # Or, use specific (but dumb) controls here in the Apache 
-    # config file instead of the AuthzSVNAccessFile above. 
-    #require user aorth akihara 
-</Location></file> 
-Gracefully restart Apache to enable the changes: 
-<code>$ sudo apache2ctl graceful</code> 
- 
-==== On The Client ==== 
- 
-Check out the development branch ("trunk") to a local folder ("myproject"): 
-<code>$ cd code/ 
-$ svn co --username=aorth https://172.26.17.2/svn/beca/trunk myproject</code> 
- 
-Import your existing code base ("mycode") into the project: 
-<code>$ cd myproject 
-$ cp -R /home/aorth/mycode/* . 
-$ svn add * 
-$ svn commit -m "Initial import of codebase"</code> 
- 
-===== Ignoring Files and Folders ===== 
-Sometimes you need to ignore certain files/folders (logs, temp files, etc) so that SVN doesn't try to commit those changes when it finds new files.  For example: ignore everything in our project's ''tmp'' folder: 
-<code>$ svn propedit svn:ignore tmp/</code> 
-And then place a single "*" in the text editor to ignore everything in the tmp folder.  Otherwise, you can do something like "*.log" to ignore all log files. 
- 
-===== Tagging Releases ===== 
-==== From trunk ==== 
-<code>$ cd myproject/ 
-$ svn copy . http://172.26.17.2/svn/myproject/tags/0.2</code> 
- 
-Switch a working copy to a certain release: 
-<code>$ svn sw http://172.26.17.2/svn/myproject/tags/0.2</code> 
- 
-===== Links ===== 
-  * http://trac.edgewall.org/wiki/TracSubversion 
-====== Trac ====== 
- 
-Create a new Trac project: 
-<code>$ sudo trac-admin /var/lib/trac/myproject initenv</code> 
-Change the permissions so the Apache user can manage the Trac environment: 
-<code>$ sudo chown -R www-data:www-data /var/lib/trac/myproject</code> 
-Configure Apache to use Python for '''/trac''' URLs.  Put settings in a new configuration file, ''/etc/apache2/conf.d/trac.conf'': 
-<file><Location /trac> 
-     SetHandler mod_python 
-     PythonHandler trac.web.modpython_frontend 
-     PythonOption TracEnvParentDir /var/lib/trac 
-     PythonOption TracUriRoot /trac 
-</Location></file> 
-The ''TracEnvParentDir'' option tells it to allow access to all Trac instances in the specified directory. 
- 
-Add Active Directory support for login URLs: 
-<file><Location /trac/myproject/login> 
-   AuthName "Microsoft Active Directory Authentication" 
-   AuthType Basic 
-    
-   PerlAuthenHandler Apache2::AuthenMSAD 
-   PerlSetVar MSADDomain ilri.cgiarad.org 
-   PerlSetVar MSADServer 172.26.0.218 
-    
-   #require valid-user 
-   require user aorth akihara jmagochi 
-</Location></file> 
-This will tie Active Directory authentication into the login system for Trac.  We use the same scheme for SVN too, so users will be able to log in as the same user they are submitting code as. 
- 
-Add a user as an admin in a particular Trac project: 
-<code>$ sudo trac-admin /var/lib/trac/myproject permission add aorth TRAC_ADMIN</code> 
- 
-===== Resync Trac/SVN ===== 
-If your Trac gets out of sync with your SVN repository you will have to resync them: 
-<code>$ sudo trac-admin /var/lib/trac/myproject resync 
-Resyncing repository history...  
-1 revision cached. 
-Done.</code> 
- 
-===== Links ===== 
- 
-  * http://trac.edgewall.org/wiki/TracAuthenticationIntroduction 
- 
-====== Redmine ====== 
- 
-  * Official install guide: http://www.redmine.org/wiki/redmine/RedmineInstall 
-  * Unofficial install guide: http://library.linode.com/development/project-management/redmine/ubuntu-9.10 
-  * Arch Linux wiki guide: http://wiki.archlinux.org/index.php/Redmine_setup 
- 
-===== Install dependencies ===== 
-==== aptitude ==== 
-<code># aptitude install build-essential rake ruby1.8 ruby1.8-dev irb1.8 rdoc1.8 zlib1g-dev libopenssl-ruby1.8 libzlib-ruby libssl-dev rubygems1.8</code> 
- 
-==== Download ruby gems ==== 
-Problems I faced: 
-  * DNS is screwed up for rubyforge.org and rubygems.org. 
-  * rubyforge.org has old versions of some gems (rails!) 
- 
-You SHOULD be able to ''gem install'' the modules, but I downloaded them all manually and installed manually.  It turns out it was a DNS issue, and I had to add some entries to the machine's ///etc/hosts// file: 
-<file>216.137.39.169  production.cf.rubygems.org d2chzxaqi4y7f8.cloudfront.net 
-72.21.202.165   production.s3.rubygems.org</file> 
-Don't ask.  I guess they are using the "cloud" and Amazon to host the files.  I found these IPs from doing DNS queries outside ILRI. 
- 
-<code>$ wget http://rubygems.org/downloads/rack-1.0.1.gem 
-$ wget http://rubygems.org/downloads/rails-2.3.5.gem 
-$ wget http://rubygems.org/downloads/mysql-2.8.1.gem 
-$ wget http://rubygems.org/downloads/sqlite3-ruby-1.3.0.gem 
-$ wget http://rubygems.org/downloads/rake-0.8.7.gem 
-$ wget http://rubygems.org/downloads/fastthread-1.0.7.gem</code> 
- 
-==== Install gems ==== 
-Rake, for building gems: 
-<code># gem install rake-0.8.3.gem</code> 
-Make sure you can execute the ''rake'' binary: 
-<code># cd /usr/local/bin/ 
-# ln -s /var/lib/gems/1.8/bin/rake</code> 
-Continue installing gems: 
-<code># gem install rack-1.0.1.gem 
-# gem install fastthread-1.0.7.gem 
-# gem install mysql-2.8.1.gem 
-# gem install sqlite3-ruby-1.3.0.gem 
-# gem install rails-2.3.5.gem</code> 
- 
-===== Configure Redmine ===== 
-Download and unzip the latest stable tarball: 
-<code>$ wget http://rubyforge.org/frs/download.php/70486/redmine-0.9.4.tar.gz 
-$ tar zxf redmine-0.9.4.tar.gz</code> 
- 
-==== Move redmine ==== 
-Move redmine somewhere universal, outside of your home folder.  We will configure Apache to serve redmine from this location: 
- 
-<code>$ sudo mv redmine-0.9.4 /opt/ 
-$ cd /opt/redmine-0.9.4</code> 
- 
-==== Configure the database ==== 
-We can either use MySQL or SQLite.  SQLite has less overhead, and I'm not sure if it's any slower so we'll use that. 
- 
-Edit //config/database.yml//: 
-<file> production: 
-   adapter: sqlite3 
-   dbfile: db/redmine.db</file> 
- 
-==== Initialize the database ==== 
-<code>$ chmod 600 config/database.yml 
-$ rake rake generate_session_store 
-$ RAILS_ENV=production rake db:migrate 
-$ RAILS_ENV=production rake redmine:load_default_data</code> 
- 
-==== Test the server ==== 
-Before we can use Redmine with Apache, we have to make sure the installation worked fine.  Use the built-in webserver to test first: 
-<code>$ script/server -e production</code> 
-If you get an error about not finding ruby, make sure the ruby version in the ''script/server'' script is correct. 
- 
-Navigate to http://ip:3000 to see Redmine working.  The default username and password are "admin" 
- 
-====== Configure Apache ====== 
- 
-===== Install Phusion Passenger ===== 
-Phusion Passenger ("mod_rails") is an Apache module which allows Apache to run ruby code (like mod_perl, mod_php, etc). 
- 
-  * Reference: http://www.modrails.com/install.html 
-  * Also the guide on the [[http://wiki.archlinux.org/index.php/Redmine_setup#Apache_w.2F_Phusion_Passenger|Arch Linux wiki]] 
- 
-==== Install the gem ==== 
-<code># gem install passenger</code> 
- 
-==== Install the Apache module ==== 
-Edit the invocation line of the passenger installer program to point to ''ruby1.8'': 
-<file>#!/usr/bin/env ruby1.8</file> 
-Run the installer: 
-<code># /var/lib/gems/1.8/gems/passenger-2.2.14/bin/passenger-install-apache2-module</code> 
- 
-==== Configure Apache settings ==== 
-Apache will serve Redmine via FastCGI using the included ''dispatch.fcgi'' script.  This is much faster than using Webrick or regular CGI. 
- 
-==== Fix dispatch.fcgi ==== 
-Rename it and make sure its executable: 
-<code>$ mv public/dispatch.fcgi.example public/dispatch.fcgi 
-$ chmod 755 public/dispatch.fcgi</code> 
- 
-Edit the invocation line in the FastCGI script to make sure it points to your ruby version (''ruby1.8''), and that the ''dispatcher'' line is correct: 
-<file>#!/usr/bin/env ruby1.8 
-... 
-require "/var/lib/gems/1.8/gems/rails-2.3.5/lib/dispatcher.rb" 
-...</file> 
- 
-==== Fix permissions ==== 
-Change permissions so the web server can read/write important files/folders: 
-<code>$ chown -R www-data:www-data /opt/redmine-0.9.4</code> 
project_management.1276084859.txt.gz · Last modified: 2010/06/09 12:00 by 172.26.14.218