Note that there are some explanatory texts on larger screens.

plurals
  1. POSet a Jenkins variable after reading console log line / value --OR-- using the variables used by scripts / commands what Jenkins calls
    primarykey
    data
    text
    <p>I DONT need the following:</p> <ol> <li>How to set a Jenkins env variable or</li> <li>How to use a environment variables in Jenkins / windows shell / ant / etc scripts.</li> </ol> <p>What I need is opposite of that.</p> <p>Summary: 1. I have a Jenkins job: ABC_Build 2. This job calls a .bat file (which calls an ANT code / target for packaging / building a build). As we are creating a build, this job know what's the new build label name and ANT is storing it in a variable called "new.build.label". File used is build.xml.</p> <p>(A NOTE to novice users: If you want to call many Windows commands (.bat / .cmd or commands which creates a windows shell) then, you should call it using "call<br> script.bat -Dparam1 -Dparam2...." way).</p> <ol> <li><p>Now, this job calls an another .bat file (which calls an ANT code /target) and uses one of the parameter value which gets generated by first .bat file / ANT package target call (i.e. "new.build.label"). As this is a separate .bat command call to call a new session of ANT code/target, I need to pass the value of "new.build.label" during the call of this step. File used here is deploy.xml.</p></li> <li><p>Basically, I'm trying to see how can I set a variable in Jenkins, either by using: a. reading the console output of my Jenkins job as I'm echoing the value of new build label in the standard output / console output. b. any other way, where I can set a jenkins variable using "new.build.label" ANT variable (once first .bat / ANT package target is finished) and I'm ready to call the 2nd .bat / .cmd / ANT call for doing deployment. Unfortunately, I can't do both package / deploy at the same time.</p> <p>I'm also not interested in knowing WHY CAN'T I call target deploy from first ANT session when I already know the value of "new.build.label" as my main request is:</p> <p>HOW TO set a jenkins variable using a "variable" which was used by one of the scripts (ANT/Jelly/Groovy/Maven/etc) that Jenkins called.</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload