Reputation: 3171
I have a Jenkins job where I execute a groovy script. From within that groovy script I make a POST request to another application. My Jenkins server and application are on different machines. I need to get access to the Jenkins environment variable from within the application's code. Is this at all possible?
I have tried to retrieve the environment variable by using the System.getenv("ENVIRONMENT-VARIABLE-NAME") method, but the result returned is null.
Upvotes: 0
Views: 232
Reputation: 1621
Updated:
I think, It can't be. If you are using POST
, then you can send the variables as query/path params to your application.
You can get ur env variable in your jenkins server like this:
${env.ENVIRONMENT_NAME}
Upvotes: 1