I have a Jenkins pipeline job which is configured as "pipeline script from SCM", pointing to a Jenkinsfile in SVN. For example, the SVN URL is http://example.com/svn/myproject/trunk/ The jenkins master does a shallow checkout (root files only) and then finds the Jenkinsfile at the root.
This URL is repeated within the Jenkinsfile, in the step which checks out the SVN workspace on a separate jenkins agent.
So whenever I clone the jenkins job for a new branch, I need to fix up the URL in two different places: once in the jenkins job config where it points at the Jenkinsfile, and once within the Jenkinsfile. Is there a way to avoid this, e.g. by reading the current job configuration from the Jenkinsfile?