Reputation: 311
I used the Pipeline script from SCM method to build, like this:
Here you need to fill in a svn url, but my svn has many branches, like this:
172.20.1.1/testProject/trunk/xxx
172.20.1.1/testProject/branches/xxx
172.20.1.1/testProject/branches/yyy
Each of these branches has its own jenkinsfile, so when I submit a new code in a branch, I need to start a new build. When building, I decide which branch to use according to the parameters I filled in, so I put the Repository here The URL is changed to a parameterized format, but it doesn’t work no matter how I test it.such as: $SVN_URL,${SVN_URL}, etc.
He will give error
can you give me some help, thanks in advance
Upvotes: 2
Views: 917
Reputation: 71
From my point of view, your issue is not so much with the job configuration.
Defining a parameterized job and referencing the variable later in that job is fine (no matter the variable format, e.g., $var
or ${var}
).
However, you seem to suffer from a bug in the underlying pipeline SCM plugin.
I am summarizing the SO answer that solved it for git-based Jenkins pipeline jobs but also applies to svn-based jobs: https://stackoverflow.com/a/57065165/1994888 (credits go to @rupesh).
The issue seems to be with the scm-api-plugin (see the bug report in the Jenkins issue tracker), hence, it is not specific to a version control system.
Upvotes: 2
Reputation: 11
I had the same problem and I solved it settin base path of url repo
Create Globals properties in "Manage Jenkins" -> "Configure System" Name: SVN_URL Value : http://172.20.1.1/testProject/trunk/
In the job configuration set the repository url base parametrized: ${SVN_URL}/xxx
Inside SCM configuration in Check-out Strategy: Check the option -> Quiet check-out
Upvotes: 1