3

In Jenkins I have a string parameter HOST. After this parameter I have a dynamic parameter URL. This parameter needs to be a concatenation of strings, including the previously defined HOST parameter.

I have been unable to find out how to do this.

The motivation for this is subsequent parameters will also use this HOST parameter.

2 Answers 2

3
+200

Just make sure I understand your requirement correctly: you have two parameters and the later one is depends on the value of the first one?

If it's so I think plugin Parameterized Build is enough for this:

  • Job configuration:

parameter definition enter image description here

  • Build with specified value:

Build with specified value

  • Build result:

Build result

  • If you change your HOST value at build, the URL will also changed.

Hope this helps :-)

Sign up to request clarification or add additional context in comments.

2 Comments

Perfect - just the ticket
Glad to help :-)
3

The dynamic parameter plugin might not be the right choice for your task. If you want the URL parameter to be updated according to the changes in the HOST parameter, you should consider using the Active Choices Plugin.

In your case, create a String parameter for the host, and an active choice reactive parameter for the url. this parameter reads the host and updates the url. example:

enter image description here

(you can find another example here: https://stackoverflow.com/a/42871619/947784)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.