Hudson doesn't checkout using symlinks when using SVN (Subversion)
Asked Answered
B

4

1

The problem is that when Hudson checks out the files, it doesn't use symlinks. I've tried the svn13 and svn14 plug ins, but neither worked.

Berneicebernelle answered 5/8, 2010 at 18:23 Comment(2)
Be careful with symlinks in repositories. I opened up a bug ticket in JIRA for hudson: issues.jenkins-ci.org/browse/JENKINS-9856 Essentially, symlinks linking outside your check-out directory can cause the files/folders to be deleted when Jenkins cleans the workspace.Berneicebernelle
Resolved this problem as a part of 1.30 as well.Disjunction
B
5

In linux, edit your /etc/init.d/hudson script file:

Look for a line that looks like:

$SU $HUDSON_USER --shell=/bin/bash -c "$DAEMON $DAEMON_ARGS -- $JAVA $JAVA_ARGS  -jar $HUDSON_WAR $HUDSON_ARGS" || return 2

Change it to:

$SU $HUDSON_USER --shell=/bin/bash -c "$DAEMON $DAEMON_ARGS -- $JAVA $JAVA_ARGS -Dsvnkit.symlinks=true -jar $HUDSON_WAR $HUDSON_ARGS" || return 2

Save the file and type:

sudo /etc/init.d/hudson stop
sudo /etc/init.d/hudson start

In summary, you're essentially looking to pass JAVA -Dsvnkit.symlinks=true so that symlinks are resolved to folders instead of a file.

Berneicebernelle answered 5/8, 2010 at 18:26 Comment(0)
A
2

In CentOS, the line you should change reads:

JAVA_CMD="$JENKINS_JAVA_CMD $JENKINS_JAVA_OPTIONS -DJENKINS_HOME=$JENKINS_HOME -jar $JENKINS_WAR"

Change it to:

JAVA_CMD="$JENKINS_JAVA_CMD $JENKINS_JAVA_OPTIONS -DJENKINS_HOME=$JENKINS_HOME -Dsvnkit.symlinks=true -jar $JENKINS_WAR"

And restart jenkins

Avaria answered 2/6, 2011 at 12:6 Comment(1)
Thanks for posting the discrepancy between distributions!Berneicebernelle
D
2

I'm not sure which version of the subversion plugin you've tried, but as of subversion plugin 1.30 it works out of the box.

I guess SVNKit at some point change the default from doing symlink by default, and Jenkins benefited from it.

Disjunction answered 12/8, 2011 at 17:6 Comment(2)
Yah, come to think of it, when I installed it on a Fedora box back in like march or may, I didn't need to do it that time. Good thing to point out to those using more current versions that doing this isn't really necessary anymore.Berneicebernelle
I'm running jenkins latest version on CentOS and it still doesn't work without adding svnkit.symlinks=true optionAvaria
C
1

If you want to edit this setting per slave node, this worked for me:

From Jenkins UI:

  1. Disconnect node
  2. Click on slave node, Under Configure -> Advanced -> JVM Options:
  3. Add line: Dsvnkit.symlinks=true
  4. Relaunch slave
Caracaraballo answered 21/7, 2016 at 1:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.