How JavaScript to get Jenkins Environment Variables?

740 views
Skip to first unread message

Brute

unread,
Jun 28, 2012, 9:43:16 PM6/28/12
to Jenkins Developers
As the title, how can I make the java script to get Jenkins envirnment
variables which are set in Global properties of Manage Jenkins->Config
System?

Thank you!

Christoph Neuroth

unread,
Jun 29, 2012, 3:26:48 AM6/29/12
to jenkin...@googlegroups.com
Hi,
Depends on what you mean by "the java script": If you're running on node, you can access them through process.env. If you're talking about JavaScript executed in a browser, I doubt you can access the Systems environment variables. You could inject them by running a small utility that dumps your environment variables to a JSON-Object, write it to a .js file and include that in your browser. Of course this will be a snapshot of the environment and in your browser you will not get any changes to the variables made at a later point.
Chris
Reply all
Reply to author
Forward
0 new messages