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:

  1. "trigger parameterized build on other projects"
  2. "current build parameters"
  3. "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:

enter image description here

2/ demo, add "post-build task" step read variable

enter image description here

3/ here console output, works :)

enter image description here


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -