Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter Community Voice - HOWTO: Set up a CodeIgniter project in Subversion
#11

[eluser]wdm*[/eluser]
I guess you shouldn't track the user_guide, right?
#12

[eluser]Don Faulkner[/eluser]
I really like the idea of tracking CI out of SVN, so I'll incorporate that. For the application, I've tried a similar, yet different approach.

I wanted to separate my application code completely from the CI source tree. I also wanted to be able to use a single CI source tree for all of my applications. For the time being, everything is under a user's home directory. Here's what it looks like:

$HOME/public_html/index.php
$HOME/public_html/application/[ config | controllers | ... ]
$HOME/lib/CodeIgniter -> CodeIgniter_1.6.3./

In my index.php, I've made the following assignments
Code:
$system_folder = "/home/username/lib/CodeIgniter/system";
$application_folder = "application";

I suppose the big difference is that the CI tree isn't in the public web space, my application is. The part that I like is that I can have multiple applications, either in parallel with each other, or nested in sub-directories. All point back at $home_dir."/lib/CodeIgniter/system" which leaves me with a single CI tree to keep updated. It wouldn't be hard to reference multiple versions either, if something unique broke or changed with a CI update.

I don't think my method allows "one-click" SVN updates, since the CI tree and the app tree are intentionally separated (to allow for multiple apps). I'll look for a way to have my cake and eat it too.
#13

[eluser]Spir[/eluser]
Yeap it should be a bit more explained on some informations. I set this using TortoiseSVN. So I look at this :
http://justaddwater.dk/2007/10/23/settin...rtoisesvn/
the point 3, 4 & 5 need to be more detailed.
how can I let the external svn ignore the application forlder?
#14

[eluser]ccb.kscott[/eluser]
I am also curious about the application folder that is in the CI system folder.

I have to remove that from the system folder (put in place by the svn:externals) in order to create a symlink to the app folder.

How do I do that without a) having svn keep trying to update the system/application folder as it is updated in the CodeIgniter repository (I want to track trunk with this)

or b) potentially removing it from the CodeIgniter repo? I certainly don't have permissions for that, but still, it seems odd.

[Edited later...]
OK, it's a little extreme to think that I could remove the application folder from the CI repo. But when I removed the local copy of the folder (with a normal rm -rf application) and add the symlink, I get a message that the folder is locked when I try to update.

This makes more sense, but still, how to avoid?

Thanks,
#15

[eluser]ccb.kscott[/eluser]
[quote author="Bramme" date="1221147561"]I've just been reading up on SVN, got myself a free beanstalk account to mess around with it and decided I'd give it all a whirl with the current CI application I'm developing.

However, the guide's rather short and with the little explanation about symlinks there is, something tells me that the people who know about symlinks, will know how to setup the project as described.

I'd love to see a more hands on, better detailed explanation off everything. And a solution for Windows, if possible.[/quote]

A solution for Windows would be to use the junction tool from SysInternals instead of a symlink.

Junction allows an NTFS file system to have unix-style links in a folder.
#16

[eluser]Unknown[/eluser]
I'd like to add a tip of mine for those deploying sites via svn.

I always rename these two files:

config.php -> config_template.php
database.php -> database_template.php

before doing my first commit, then I make duplicates of the files and remove the "_template" part and never commit the new config.php / database.php files. the reason is because obviously from server to server your config and db settings are going to be different. whilst you could faff with svn:ignore to do something similar, I find it is helpful to have the original base file committed as a template.
#17

[eluser]brianw1975[/eluser]
[quote author="Tom Glover" date="1221167042"]Tortoise SVN is the only good option for Windows.[/quote]

I know this is months later, however I waned to say that I disagree, I find that RapidSVN works much better when dealing with network and remote repositories than Tortoise; it is free also, so anyone having problems with Tortoise (like I did) they should give RapidSVN a shot.
#18

[eluser]SitesByJoe[/eluser]
SVN pops up more and more and is clearly the "now" way to develop software. Understanding this, anyone with more information on symlinks etc should post it here as SVN takes a while to get your head around. I'm just learning it now and downloaded the latest version in the trunk.

If by the time I learn enough to pass on my learnings, I'll do so - in the meantime this is certainly a big topic that'll only grow moving on.
#19

[eluser]Unknown[/eluser]
Hi Derek,

I saw some problems in this approach like other members have noticed with the externals stuff, so I decided that I was going to try your very good idea but avoiding this problems, and this is what I finally did:

I created a public directory and I put all the symbolic links there. I put a copy of the index.php with the configuration pointing to the app directory outside of the "ci" codeigniter folder.

public/
-----------------------------
.htaccess -> ../site-extras/.htaccess
images -> ../site-extras/images/
index.php
js -> ../site-extras/js/
system -> ../ci/system/

and I have the external at the root of the project, like this:

ci http://dev.ellislab.com/svn/CodeIgniter/tags/v1.7.1

Then I have all the advantages of your approach but without having to deal with the svn:externals problems that I found in it.

Thank you for your good idea.
#20

[eluser]madmaxx[/eluser]
I've changed my basic CI layout after a year of hosting several CI web applications on Ubuntu/AWS:

Code:
application/
  configure
  lib/
      ci/    <--- CodeIgniter via svn:externals
      wp/
  public/    <--- resources, lib symlinked (point vhost here)
  resources/
  static/

Changes from last year's post:

* The public`folder is no longer svn:extern'd to CI, instead it's symlinked to the lib folder that's externally linked. This fixes a Subversion annoyance where `svn up` reported a circular reference.
* The lib folder can contain other libraries like Markdown, ExpressionEngine, jQuery, and so on (all of which you can link using svn:extern)
* index.php is modified by the configure script to reference the root level `application` folder (instead of symlinking)
* the `configure` script is renamed to a more standard name, and it does the symlinking, permissions work, and vhost setup (if needed)

This approach is not workable on Windows (lacking symlinks), but it works well on all *nix hosts including OS X.

Note that the `svn:extern` + scripted approach (including decoupling CI) makes it easy to patch a server quickly. This is a serious, and important security principle. It also makes it easy to upgrade portions of the application by themselves without much thought. We can bring our servers up in < 3 minutes (including reboot) after a fatal issue using this method. It's super duper.




Theme © iAndrew 2016 - Forum software by © MyBB