2

I have a job in which the developer changes a file and checks back in in SVN. As soon as the developer checks in the file, Jenkins has to trigger a build and copy that changed file (not entire directory) from SVN to a target server.

For example, a developer checked in a file in trunk in SVN. Trunk contains a huge number of files, but Jenkins needs to copy only the changed file from the SVN trunk folder to a target server.

How this can be achieved? Is there a plugin or functionality that helps support this feature?

Peter Mortensen
  • 30,030
  • 21
  • 100
  • 124
Kishore Tamire
  • 1,944
  • 5
  • 20
  • 25

2 Answers2

3

You cannot check out a single file from Subversion. The smallest unit you can check out is a directory.

If you already have a working copy, an svn update will pull the differences.

You can use svn export or svn cat to extract a single file from the repository, but it will not have a connection back to the repository when you're finished (unlike a working copy).

alroc
  • 26,843
  • 6
  • 49
  • 94
  • You can check out a single file from Subversion. [It is done in two steps. First checkout an empty directory and then update a single file](http://stackoverflow.com/questions/122107/checkout-one-file-from-subversion/122291#122291). – Peter Mortensen Dec 09 '13 at 13:06
  • That's not checking out a *file*. That's checking out a sparse working copy and then selectively updating. – alroc Dec 09 '13 at 14:04
0

Maybe you can setup another folder in SVN which will have svn externals link to that one file, and then check out that 1 folder.

As for deploying that to the server, that's up to you how you do that (plugins, scripts, whatever)

Slav
  • 26,161
  • 10
  • 74
  • 99