Variables

Define variables in the pipeline

Customize variables when orchestrating the pipeline

Sets variables in the pipeline plug-in

If you develop your pipeline plug-in in bk-ci, you can define the output field in the plug-in's task.json file, which also allows you to declare these variables when you run the plug-in.

Set variables through the Bash plugin

You can set the parameters passed between plug-ins using the setEnv function in the Shell Script plug-in as follows:

#!/usr/bin/env bash
# setEnv "FILENAME" "package.zip"
# Then reference this variable with ${FILENAME} in the form of subsequent plug-ins```

References variables in the pipeline

You can use the variables defined above in any plugin form by referring to them as ${KEY}

Set the variable value when the pipeline is manually triggered

  1. When the pipeline variable is defined during the editing process and the "Display during execution" option is enabled, the pipeline preview page will be displayed after the pipeline is run.

The Key variable cannot be modified during execution, only the value variable can be modified.

Next you may need

Last updated