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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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.