bash - can't export a variable from execute shell in Jenkins to other project (with using properties file) -
i have jenkins project 1 "execute shell" executes bash commands , exports 1 variable env. variables:
#!/bin/bash ... target_fullpath="blablabla" export target_fullpath
in addition, have configured "post-build actions" with:
- "trigger parameterized build on other projects"
- "current build parameters"
- "predefined parameters" -> fullpath=$target_fullpath
but, when run project other project start first 1 finished seems doesn't parameter fullpath @ all!
at least in "execute shell" (of second project) bash script print nothing echo $fullpath! @ "environment variables" of second project fullpath not included!
any clue doing wrong?
one more thing, can't use properties file store parameters, since 2 projects running on different servers , there restrictions on copying files between servers!
did have solution? jenkins: how use variable pre-build shell in maven "goals , options"
using shell pre-build step + injectenv plugin, should able solve problem.
update june 22nd, add screen copies.
1/ add first "execute shell" script create properties file , "inject environment variables" step load properties file:
2/ demo, add "post-build task" step read variable
3/ here console output, works :)
Comments
Post a Comment