I need to
In a shell script build step params can easily be accessed using env variables. Do I have to do the same in Jython? (can I do it at all)?
I'm not sure about how you can access the variable from Parameterized parameter in Execute Jython script
in Build
section but if i run the Jython script in Windows (after selecting Execute Windows batch command
option from the dropdown list in Build
section), it works fine. Check the snapshots below where i have used Parameterized Trigger Plugin for creating a String Parameter and then using the same in Jython script. It works fine and displays the value of the variable in output.
Here's the sample script i used for accepting parameter:
import sys
for arg in sys.argv:
print arg
For *nix environment, you obviously have to select Execute shell
in Build
section's dropdown list and also change %var%
to $var
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.