Posts mit dem Label ignore werden angezeigt. Alle Posts anzeigen
Posts mit dem Label ignore werden angezeigt. Alle Posts anzeigen

Dienstag, 20. Mai 2008

Using Rails with SVN

1. mkdir getready
2. cd getready
3. rails projectname
4. mv projectname trunk
5. mkdir tags
6. mkdir branches
7. cd trunk/config
8. mv database.yml database_example.yml
9. cd ..
10. rm -r tmp/*
11. rm -r log/*
12. cd ..
13 svn import . http://path_to_repository -m "initial import"
14. ...now you can get rid of getready folder - we dont need it anymore
15. svn co http://path_to_project_trunk projectname
16. cd projectname
17. cp config/database_example.yml database.yml
18. add passwords to the database entries
19. svn propset svn:ignore database.yml config/
20. svn propset svn:ignore "*" tmp/
21. svn propset svn:ignore "*" logs/
22. svn commit -m "ignoring files"
23. svn copy http://from_repository_trunk http://repository_tag_path_REL_XXX -m "initial snapshot release"

############################
# just a few things to remember
############################

1. when generating a model, controller or scaffold use the following

useraccount>ruby script/generate scaffold angry farmer bales_of_hey:integer name -c

DON'T FORGET THE -c AT THE END!!!

2. When installing a plugin

ruby script/install name_of_plugin -x

also a great railscast on the basics.

Working

To see the status of the files in the repository use:

useraccount> svn status

To commit changes to the files

useraccount> svn commit -m "somthing about what you are commiting"

To add files that you have changes (they have a ? next to them when you see the status).

useraccount> svn add directory_and_name_of_file

to ignore files

useraccount> svn propset svn:ignore *.pyc dirname
or
useraccount> svn propset svn:ignore dirname

setting up svn with a rails 2.0.2 project

more or less got this from here.

Go to the directory you want to set up the rails project in.

then

useraccount> mkdir svn_setup
useraccount> cd svn_setup
useraccount> rails project_name -d mysql
useraccount> mv project_name trunk
useraccount> mkdir tags
useraccount> mkdir branches
useraccount> cd trunk
useraccount> rm -r tmp/*
useraccount> rm -r log/*
useraccount> mv config/database.yml database_example.yml
useraccount> cd ..
useraccount> svn import . url_of_svn_repository_space_on_assembla -m "initial repository import" --user name_of_assembla_user

now the project should be in the svn repository in assembla

now checkout the project from the repository in assembla to your localhost

useraccount> cd
useraccount> svn co url_of_svn_repository_space_on_assembla/trunk project_name

project_name is now what you can work on and thus you can get rid of the svn_setup folder you made earlier.

useraccount> rm -r svn_setup

now for the last bits and bobs.

useraccount> cd project_name
useraccount> cp /config/database_example.yml database.yml

useraccount> svn propset svn:ignore database.yml config/
useraccount> svn propset svn:ignore "*" log/
useraccount> svn propset svn:ignore "*" tmp/