user2880391
user2880391

Reputation: 2791

Teamcity- run custom script with parameter

I've created a project in Teamcity that runs command line Custom script. I want to add parameters to the script. something like:

./run.sh parameter

I want to be able to enter different parameter when running the build. as I understand I can do it from the 'Run Custom Build' - but I didn't figure out how exactly to enter a parameter for the custom script.

Upvotes: 2

Views: 3620

Answers (2)

Biswajit_86
Biswajit_86

Reputation: 3739

In the configuration options for Build parameters, you can declare paramters that are textbox,checkbox or dropdown. You can read more about them in the official documentation here

This is an example for a textbox prompt

This is an example for a textbox prompt

When you click on the Run button you will get this prompt

enter image description here

You can use these to pass in values that change at runtime. Whenever you click on the Run button, you are going to be prompted for a value for these parameters before you can run the build. This is important, You can not run a build if you do not pass a value and click on enter.

Note that run button has 2 buttons partinioed side by side. the first button is labelled as Run, which is where you are prompted to Only change the value of variables that are dynamic. If you click on the 3 dots (ellipsis) ... button, you can change All the variables before a custom build.

Upvotes: 1

Mohammad Nadeem
Mohammad Nadeem

Reputation: 9392

You can click on ellipses on Run button.

enter image description here

And then click on prameters tab.

enter image description here

For more info, go through Defining and Using Build Parameters in Build Configuration

Upvotes: 0

Related Questions