Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8673291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:25:16+00:00 2026-06-12T19:25:16+00:00

This is starting to drive me crazy .. but it seems like I am

  • 0

This is starting to drive me crazy .. but it seems like I am out of luck to figure it out by myself :/

I need to set up a mechanism to share string value between two slaves, for example, named slave A and slave B.

Currently most closest one I have found is this SO Question:
Jenkins Slave Environment Variable Refresh

But it still aims to enable access in buildscripts, not in the Slaves environment variable itself. (related SO Question: How are environment variables used in Jenkins with Windows Batch Command?)

Currently I have this setup:

1) on A the job A is triggered.

It performs this windows batch code (actual paths, obviously, are replaced with ‘<>’):

cmd /c start java -jar <path_of_slave>\slave.jar -jnlpUrl  <url_of_slave>/slave-agent.jnlp

setenv.exe /m HOR_BUILD_ID -delete
setenv.exe /m HOR_BUILD_ID %BUILD_NUMBER%
setenv.exe /m HOR_UPSTREAM_ID -delete
setenv.exe /m HOR_UPSTREAM_ID %JOB_NAME%

Pretty self-explanatory and straight-forward imho.

2) The job on A have upstream job B, that is triggered on successful build.
So, in the slave B the B build executes this batch code(actual paths, obviously, are replaced with ‘<>’):

SetLocal EnableDelayedExpansion

@echo off
@echo --- Refreshing Environemnt variables... 
@echo on
set prgfil=%ProgramFiles(x86)%
call "%WORKSPACE%\..\..\..\tools\misc\resetvars.bat"
@echo --- Reading environment variables... 
copy /y "<path_containing_%HOR_UPSTREAM_ID%_variable" "<path_containing_%HOR_BUILD_ID%_variable"
if !errorlevel!==0 goto ok1
goto error
:ok1

goto end

:error
EndLocal
exit /b 1

:end
EndLocal

NOTE: resetvars.bat and resetvars.vbs is taken from this SO Question: Is there a command to refresh environment variables from the command prompt in Windows?


The output (%HOR_BUILD_ID% and %HOR_UPSTREAM_ID% values), still, is outdated … only way to get new variables refreshed is to restart that darn jenkins (master) service, but this is definetly no-go in the CI environment…

The question now surfaces – how to make those variables to be refreshed / re-read when the build job B on B is triggered, so I could access system variables from slave w/o using, for example, EnvInject plugin?


Another SO Question and answer that needs user interaction, therefore not acceptable in my case: Jenkins – passing variables between jobs?


This also do not work in my case: http://comments.gmane.org/gmane.comp.java.hudson.user/37897


Maybe the Slave and its coresponding node do not recieve variable / resolve its environment coreectly, causing to be unable to retrieve information form Global envirtonemtn variables? Cechked it out and suddenly some interesting Environment variable config data cought my eye:

NODE_LABELS | a prodreleases

NODE_NAME | a

… this is for slave B , but it should be different values as this is originally for slave A … What a hell??????????????????!!!! :/

I am starting to have feeling that root problem is that Jenkins has bug when resolving multiple slave NODE information.

Decided to create a Issue @ Jenkins jira: https://issues.jenkins-ci.org/browse/JENKINS-15397

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:25:18+00:00Added an answer on June 12, 2026 at 7:25 pm

    Have you looked at adding parameterized trigger plugin?

    https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin

    This should allow you to pass parameters from the first job to the second (like the job name to delete).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just starting out, this should be a simple one but I haven't been able
This is starting to drive me crazy. I'm developing an android project and as
OK this is starting to drive me crazy! I am trying to do some
This is really starting to drive me crazy; I've spend a solid two hours
Okay, this is starting to drive me a little bit nuts. I've tried several
I want to do something like this strtotime(next starting minute); If the current time
This may be a stupid question but im just starting to learn Rail thats
I have a problem that's starting to drive me crazy.. I've narrowed my problem
This is starting to drive me insane, as I've followed every instruction I can
This is really starting to piss me off. I feel like I have tried

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.