I'm going to list several quick facts for better understanding of my goal.
Am developing a project, let's call it AAA:
Every new version I develop at home I commit changes to webserver and then update the live area.
Now I want to introduce minified JS and CSS versions.
After a little Google search the way to go is SVN hooks. pre-commit and post-commit hooks.
This is what I have in mind now:
This works OK for the first commit. At the second commit the live SVN update fails because .css ans .js are already modified (minified) from the first commit. conflicts.
SOLUTION:
1# Use SVN export instead of SVN update for the live version. This takes to long and have problems with deleted files, etc. Solution EXCLUDED.
2# Force SVN to update live AAA version and ignore changes (minified files from the previous revision). This solution makes sense to me but I didn't found a way to make SVN update ignoring the current changes (minified files). Is this possible with SVN?
I tried SVN updade tf
and not working.
3# Willing to ear your solution :)
Thanks for helping.
I do not know what your environment is, but you can take the approach used by the Capistrano deployment utility.
If your live/production environment supports soft/symbolic links (such as Linux) what you do is:
Create 2 directories in your deployment path
~/path_to_site/current
~/path_to_site/releases
Set ~/path_to_site/current to be the directory that is being served
Perform an SVN export to the releases directory, e.g.
~/path_to_site/releases/mysite_1234567 (timestamp)
After the export is complete, change the path of your soft link for current/ to point to the most recent release, e.g.
~/path_to_site/current -> ~/path_to_site/releases/mysite_1234567
The benefits of this approach are:
Tools like Capistrano help automate processes like this, but are not required. Either way, something like this could be accomplished with a post-commit hook, depending on your environment.
It should also be noted that not all server configurations will allow you to use symbolic/soft links in the paths of the folders that are being served.