0

Every example I've seen for Jenkins shared library setup on the web is based on Git/GitHub. Can anyone help me with that using Subversion?
I've struggled a lot but could not figure out what should be specified as the Default version. I've tried many different combinations of Project Repository Base, Include branches, Library Name and Default version but none worked.

Attached is the screenshot of my SVN repository setup. I know it's not as per the standards though, it should work somehow as it's just a demo project.

enter image description here

Sid
  • 145
  • 1
  • 11

3 Answers3

2

if your lib svn path is https://192.168.1.1:8443/svn/trunk/JenkinsLib, then Project Repository Base will be https://192.168.1.1:8443/svn/trunk/ and Default version is JenkinsLib.

zhe han
  • 21
  • 2
1

While setting up the shared library in Configure System --> Global Pipeline libraries select Retrival Methond : Morden SCM and Source Code Management : Subversion like below picture : enter image description here

and When you select Subversion it will ask you to choose subversion specific branching name like below: enter image description here

Samit Kumar Patel
  • 1,932
  • 1
  • 13
  • 20
  • Thanks for your effort Samit. I could figure out this configuration step too. My question is more related to what values should be put into those fields while using subversion. – Sid Feb 08 '21 at 15:54
  • give the SVN url in `Project Repository Base`. create a Credentials and give the id in `Credentials `. what ever branch you are trying to include add that `Include branches`, so that when you use `@Library('shared-lib@branchName')` branchName on Jeninsfile . specify whatever branch you are planning to exclude in `Exclude branches`. – Samit Kumar Patel Feb 10 '21 at 15:53
0

I didn't want to tag a specific branch in SVN, so I just used a period (i.e. '.') in the DEFAULT VERSION field and that takes that HEAD of the repo.

The project repo base is just the svn:// path to your repo.

I hope that helps.

Oliver
  • 49
  • 5
  • This may help but too open a solution it would be - exposing complete SVN server. Well I could figure out that by "version" the configuration is asking for a default branch or tag to be used. Still, thanks for your answer. :) – Sid Jun 13 '22 at 08:16