Use variables in your pipeline

  • Variable usage type:

    • Global variable references, shell/python/windows variable reference methods

    • Plug-in variable setting methods and cross-plug-in variable references

  • Click Trigger to add the variable message

  • Add stage, select the Python script execution plugin under Job, and use variables via ${message}

Add shell plug-ins that use variables with ${message}

Add stage and select windows for the Job type

Click windows and select the windows Private Builder node

Add Batch Script plug-in, using %message% to reference variables

  • Plugin method for setting global variables On the python script execution plugin, use print("setEnv demo test1") to set an environment variable: demo (note: demo variable cannot be used in the current plugin).

The variable demo is referenced in shell script and batch script plug-ins in the same way that trigger configured variables are referenced

The way windows sets global variables, call:setEnv "test" "testmessage", references the test variable as above

  • Pipeline default global variable Click any plug-in, and there is a reference variable in the upper right corner. The pipeline defines some variables by default, which can be used directly on the plug-in. The variable reference method is as above

Last updated