Can I use subversion so that "commit" automatically updates my server files?

I would like to know if there is a way to do this so that when I make changes using Subversion, the changes are automatically reflected on my server in the test folder? Perhaps this idea is irrational. I am struggling to get a good idea of โ€‹โ€‹the big picture. If I kept the subversion repository on the server, would that be reasonable?

+4
source share
5 answers

You can install something as simple as a cron job to check for changes every minute or so.

However, in my experience, I found it more flexible to create a continuous integration / build server, such as TeamCity or Hudson, with a task that checks the svn repository every minute or so for updates. If there are updates, you can "deploy" them to the testing directory. The advantage of this route is that you can automate additional tasks, such as restarting the web server and / or running unit tests, as well as only updating upon successful completion, etc.

In addition, it is not necessary that the subversion server resides on the same server as your environment, which needs to be updated.

+4
source

I would like to know if there is a way to do this so that when I commit changes using Subversion, the changes are automatically reflected on my server in the test folder?

Oh sure. What you want is called post-commit hook - see this link for relevant SVN FAQs.

The general strategy is to have a working copy on your server. When you commit, the script call is called, and its task is to get the working copy of your server to initiate svn update .

+3
source

An alternative (and for me is preferable) is to use push after build after a successful build on the CI server. It makes no sense to enter code on a server that does not do the right thing.

+2
source

Try svnsync ?

If this is not interesting, you can do something normal with incron and rsync quite easily.

0
source

Source: https://habr.com/ru/post/1300003/


All Articles