I am googling like crazy trying to find a solution for this – but not having much luck!
I have TortoiseSVN and Subversion running on my local Windows XP machine. I make changes to my website and commit these locally. I then want to push these changes to the live website. This is hosted on our dedicated server (Windows 2008 Server).
I've spoken to the hosting company who confirmed they do not support SVN and as it's a windows box will not have SSH – so that's not an option.
Is there any software or a method I could use to push just the changes I commit back to my remote server? Or do I have to manually upload the changes using FTP (which I do at the moment which is a pain!)
Thanks for any info!
Best Answer
Side note
Windows-box can have SSH
Hints
You have to read and grok SVN Book anyway, if you want to use Subversion. Chapter 5.3.2 "Implementing Repository Hooks" tells us basics about repository (server-side) hooks (you can use hooks in your repo), later, in "Repository Hooks" discussed more deep. You'll see at post-commit hook for your task
Because you work with TortoiseSVN, you can also use TortoiseSVN client-side hooks (they handle the smaller set of of events, because work with Working Copy, not repository), which can be post-commit also
Anyway, for deploy-hook you have to write non-interactive (preferably) script (ordinary bat-file, PowerShell, exe...), which transfer /some fileset/ from you to final destination and perform some other management on the side of live site.
During planning stage you have to define, which deploy-policy you want (and able) to follow
Depending on selected the policy, command(s) of preparing fileset for transfer will differ, as well as a set of operations on the site.
Short summary
TSVN Hook (easy doable than server)
svn log -q -v --limit 1
(+some tricks for getting full localpathes) or with>svn diff --summarize -r PREV:COMMITTED
(+ exclude from list D /deleted/ filesADD-ON
Lost&Found story
I haven't ready to use recipe for "uploading only changed, in Windows" (I'm lazy and upload full exported WC, when it's needed), but have some ideas.
In these examples I use (part of) my repo
http://mayorat.ursinecorner.ru:8088/svn/Hello/trunk/
, checkouted into local dirz:\Hello\
with task "upload changed in last commit files into FTP using pure Windows-tools as much as possible"Files in last commit
z:\Hello>svn log -v -q -l 1
r33 | lazybadger | 2012-02-28 16:10:41 +0600 (Вт, 28 фев 2012) Changed paths: M /trunk/Hello.en.txt
Extract list of affected files - TBD (grep as last resort)
/trunk/Hello.en.txt
Convert filename to local path - TBD
from
svn info
we are interested in two stringsURL - Repository Root = /trunk
to which we'll add / and remove this substring from the beginning filename /trunk/Hello.en.txt, Hello.en.txt is file in the root of z:\Hello
ftp
(read about -s parameter of ftp) in commandftp -s:uploader -i -n ftp-host
, something likeuser user pass
cd /our/path
mput *.*
bye
user command can be changed to using _netrc trick.
Mput, if doesn't work recursive, will be replaced with set of put, cd, lcd, mkdir