jenkins - how to pass a value from bash to groovy? -
i'm working on jenkins install 2 script components. bash bits run first , groovy. i'd able pass value (property? other?) bash script->groovy script.
is possible? need write value property file , read in groovy?
edit: goal generate build # in bash , pass groovy set description , build # in jenkins display. appears groovy isn't available on build server i'm looking direction. experimenting 'postbuild' plugin , 'env-inject' plugin. open suggestions.
here few things consider make successful:
- make sure you're trying accomplish 1 "execute shell" in jenkins or script.
- export shell variable variable present in child process execute groovy script.
# foo.sh export foo=bar groovy myscript.groovy
# myscript.groovy def env = system.getenv() string myvar=env['foo'] println myvar
running foo.sh should produce following:
./foo.sh bar