Howto manage an svn+edgerails+capistrano environment on Gnome/Linux
Inserito da assente il 21 Luglio, 2006 - 09:24 RubyInstall svn
Subversion is a very common version control system; sometimes it's installed in your web hosting space, but if you decide to set up on you PC you are more indipendent.sudo apt-get install subversion subversion-helper-scripts subversion-toolsYou have to create the directory for the svn projects
# '/svn-stuff' is where you put your config and svn internal stuff
sudo mkdir -p /svn-stuff-- sudo gedit /svn-stuff/conf/svnserve.conf
sudo svnadmin create /svn-stuff
[general]--
anon-access = read
auth-access = write
password-db = passwd # relative path to the users file
-- sudo gedit /svn-stuff/conf/passwd
[users]
username = password
--
svnserve -d -r /svn-stuff
# it means 'daemon' and svn projects path
There's not a '/etc/init.d/svnserve start' script but you can start automatically svn server with xinetd
For more informations see Ubuntu forum and if you need the http interface you can install websvn
WARNING
+ Everything should go as expected, if you get something like "svnserve.conf:28: Option expected" probably you have to delete the space before a parameter like anon-access+ You can start svnserve with -i, but It didn't work for me
Install edgerails environment
It's very easy to do 'gem install rails' but if you want lastest stable release or your web hosting doesn't update rails frequently this is the best thing to do.We will keep latest rails in a directory called edgerails and all the apps we'll create will point the first rails path MYRAILSAPP/vendor/rails -> to edgerails/ So edgerails will be shared.
# '/projects' is the path to the dir where you store your apps
cd /projects#This alias is to have edgerails as default rails
svn co http://dev.rubyonrails.org/svn/rails/branches/stable/ edgerails/
alias rails="ruby /projects/edgerails/railties/bin/rails"
rails eapp
cd eapp/vendor/
ln -s ../../edgerails/ rails
cd ..
script/server # http://localhost:3000 and test rails version
# => Booting lighttpd (use 'script/server webrick' to force WEBrick)
cd ..
# It's the first import of the directory, and 'trunk' is the current release
svn import eapp svn://localhost/eapp/trunk -m "Import eapp"
# just to be secure that everything will go well anyway :)
mv eapp eappbak
# This will sinchronize the content with the current svn version
svn co svn://localhost/eapp/trunk eapp # with -r <number> you specify the release
#Test svn
cd eapp
echo "test" >> README
svn diff # differences with svn version
svn ci -m "added test ooh" # commit the changes to svn
svn up -r <number before> #rollback
# svn add file-or-dir # to add a file to svn
Common tasks
# -x automatically generates the svn code
script/plugin install -x acts_as_taggable
# -x automatically generates the svn code
script/generate model -c mymodel
Other stuffs
Capistrano permits to create tasks to manage your rails app# Usually the web hosting already did this for youInstall features for Gnome environment
sudo gem install capistrano --include-dependencies
cap --apply-to eapp
svn add config/deploy.rb
svn add lib/tasks/capistrano.rake
svn ci -m "added capistrano"
nautilus svn scripts to control common svn commands on a GUI!
sudo apt-get install nautilus-script-collection-svnmeld is a nicer way to see 'svn diff' with colors
edit the nautilus script 'diff' and put:
#zenity...
meld $@
Gedit rails, some basic autocompletion snippet for rails
Notes
- If you have enought RAM and CPU even Eclipse + Radrails + Subversive offers a nice environment.



Commenti recenti
10 ore 40 min fa
10 ore 52 min fa
1 giorno 20 ore fa
1 giorno 20 ore fa
1 giorno 22 ore fa
2 giorni 1 ora fa
2 giorni 2 ore fa
2 giorni 3 ore fa
3 giorni 2 ore fa
3 giorni 2 ore fa