How to pass Jenkins env variables in SaltStack Jenkins plugin

31 views
Skip to first unread message

varun bhatnagar

unread,
Mar 22, 2018, 8:52:16 AM3/22/18
to Jenkins Users
Hi,

I am trying to use SaltStack with Jenkins and I have installed and configured SaltStack plugin for the same. I want to pass BUILD_ID environment variable as a pillar during the build and in-order to achieve that I have passed this in the Arguments - "pillar={"build_id": '{{ BUILD_ID }}' }" but in the output the whole  string (i.e. BUILD_ID) gets printed.

This is how my SLS file looks like:

Info message:
  module.run:
    - name: test.echo
    - text: "{{ pillar['build_id'] }}"

Any idea how can this be achieved?

BR,
Varun

Ramanathan Muthaiah

unread,
Mar 24, 2018, 9:31:56 AM3/24/18
to Jenkins Users
If you need to access environment variables in saltstack, aren't there any methods to access them.

I have not used saltstack but you should the tool's documentation to understand how to access env vars. Using such provision, you should access env var rather than passing to saltstack.

/Ram
Reply all
Reply to author
Forward
0 new messages