Updated on 2023-11-28 GMT+08:00

Using Parameters

This section describes how to configure the releaseversion parameter in a pipeline and transfer the parameter to a build task. The operations for other tasks are the same.

Procedure

  1. Create a build task.
  2. On the Parameter Configuration tab page, add the releaseversion parameter, set the default value, and enable Runtime Setting.

  3. On the Build Actions tab page, select Upload to Release Repos and set Release Version as a reference parameter. After you enter $ in the text box, a parameter list is displayed. Select the releaseversion parameter created in the previous step.

  4. Save the build task.
  5. Create a blank template pipeline, add the Build extension and select the build task created in previous steps. The new build task parameter releaseversion is displayed.

  6. Move the cursor to the releaseversion parameter to set it as a pipeline parameter. Alternatively, click OK, switch to the Parameter Configuration tab page, create the pipeline parameter releaseversion, set Type to Auto-increment or String, set a default value, and enable Runtime Setting.

  7. Switch back to the Task Orchestration tab page, and edit the added build task. Reference the pipeline releaseversion parameter to the build task releaseversion parameter using $.

    • Only text parameters for which Runtime Setting is enabled are displayed.
    • The parameter reference format is "${ParameterName}". ParameterName specifies the pipeline parameter name. After you enter $ in the parameter text box, the parameter list is automatically displayed.
    • You can move the cursor to a parameter name to quickly set the parameter as a pipeline parameter and directly reference the parameter.

  8. Save the information and click Save and Run. In the displayed dialog box, you can view the running configuration.

    For the runtime parameter, the value is the default value specified when you add the parameter. You can change the value as required. When the pipeline is run, the parameter value used in the build task is the value you set here.

  9. Click Run to execute the pipeline.