Monday, March 2, 2009

Setup of a new rails app with svn

The easiest way to setup a new repository for your rails application is to ssh into the repository host and then using terminal type as root

svnadmin create /path/to/repos/new-repo-name
Then to lock it down without using ssh and using the provided svnserve program running as a daemon on the host run this command from the newly created repository directory

vi conf/svnserve.conf
Make sure to set in the [general] section anon-access = none and auth-access = write Also make sure to uncomment password-db = passwd Then after you save those changes execute the following

vi conf/passwd
Add an entry for yourself and whomever you'll be sharing this repository with, like other developers and such. Save and quit. While in the same repo directory go ahead and make a temp directory and inside the temp directory create three directories ( trunk, tags, branches )

mkdir trunk tags branches
You'll want to import these directories into your repo.

svn import . [svn-host] -m "dir import"
You can now remove the temp directory you created and exit out of ssh. Navigate to where you would like your rails application to live on your local machine and create the rails application

rails mynewapp
cd into the new rails application and then issue a svn import to import the new rails app into your repository

svn import . [svn-host]/trunk -m "initial app import"
You may now remove the app you just created on your local machine, because we will be checking it out from the repository and your repository will have all the latest changes.

svn co [svn-host]/trunk
Now let's ignore the database.yml file, the tmp and log directories

svn propset svn:ignore database.yml config/
svn propset svn:ignore '*' tmp/
svn propset svn:ignore '*' log/
That should do it, your database.yml file, your log and tmp directory will not be checked into your repository.

No comments:

Post a Comment

Raspberry Pi Zero W - Wireless Configuation

create the file under "boot" folder wpa_supplicant.conf country=GB ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev u...