Trying to get rsync to copy files back to svn

I'm trying to set up a specific workflow, but don't know how (or if) rsync will work for this.

My setup is on Mac OS X.

I have an SVN directory. When I run the deployment script, the files are transferred to my Apache integration server. I do my modifications on files and then manually copy them back to SVN.

The reason I did this is because I need to see the changes immediately in the browser as I am editing html, css and javascript. But it takes a lot of time trying to manually copy and track this and I want to automate it.

What I want to do is use rsync to identify the files that I have changed in the Apache web directory and then copy those files over to SVN only.

I have an rsync command that I tested, but the problem I seem to be running into is that since the timestamps of the deployed files are newer than SVN, rsync wants to copy all the files because it sees them as newer files.

I also experimented with diff and it detects file differences. I suppose I can put together a shell script that can use a combination of diff, grep and cp to do the job, but I would like to see if rsync can be an all-in-one solution.

rsync -avuzn --exclude=web-inf/classes/ --exclude=web-inf/lib/ /var/www/web-inf /usr/local/src/svn/WEB-INF

      

+2


source to share


4 answers


I recommend doing subversion validation directly on the web server. You must add a Deny directive for all named Files.svn

so that remote users will not recognize this as a subversion check.



+3


source


You are not talking about how your deployment script moves files to the integration server, and it is not entirely clear if multiple machines are involved or what filesystem is included in the integration server files. If the script does everything right, you can save the file modification time when the files were originally uploaded. Since you can use rsync to send them back, can't you also use rsync to send them in the first place? If it is not, scp -p is another way of passing, keeping many of the attributes.



However, this workflow sounds specifically for a distributed version control system like mercurial or git .

0


source


What I don't understand here, what exactly are you doing? Generally speaking, you have to develop on your own computer. Your svn repository must be located in your Sites directory so that you can view the site live in your browser via localhost. I use Rails with git in the same way. My local ruby โ€‹โ€‹server goes to localhost: 3000 and I can evolve and see what I am doing all the time. Then, when my coding hits a decent point, I commit to git and deploy to my test server. Once the site is complete, it goes into production. When I code in php / mysql, I test on my local apache server and then directly ftp to the testing or production server when I'm done.

This is how you should work. There is no reason to copy stuff from your test or production servers. And your source control should do all the sync. Develop locally, check remotely, then deploy to Production. This is the best way to do it.

0


source


I also experimented with automatic deployment, and after I wrote my own rsync-script ... (easy to use but requires installation, I came across DeployIt ... Try it ...

http://deployit.monavari.de/

0


source







All Articles