Sree
Sree

Reputation: 41

Is it possible to use the parameters in a Jenkins parameterized build in the SCM URL?

I wanted to use the value of a parameter in a parameterized build as part of the Repository URL and Local Module directory in the SCM of Jenkins.sample job

Please let me know if it is possible and how to do it.

Upvotes: 0

Views: 565

Answers (1)

Ian W
Ian W

Reputation: 4767

Yes. See Parameterized Build.

The option is in General tab, "This build is parameterized". It's built-in.

Your choice of parameter type, the name of the parameter is the variable to use. eg:

http://path.to.repo/${projectName}

Takes the first/default value if triggered by web hook or timer.

We use for both dynamic repo and branch selection.

There's also plugin build with parameters, (no experience) similar but different. There are additional similar parameter plugins too.

Upvotes: 1

Related Questions