For some reason sudo su - jenkins
does not log me to jenkins
user, I ended up using different approach.
I was successful setting the global env variables using using jenkins config.xml
at /var/lib/jenkins/config.xml
(installed in Linux/ RHEL) - without using external plugins.
I simply had to stop jenkins add then add globalNodeProperties
, and then restart.
Example, I'm defining variables APPLICATION_ENVIRONMENT
and SPRING_PROFILES_ACTIVE
to continious_integration
below,
<?xml version='1.0' encoding='UTF-8'?>
<hudson>
<globalNodeProperties>
<hudson.slaves.EnvironmentVariablesNodeProperty>
<envVars serialization="custom">
<unserializable-parents/>
<tree-map>
<default>
<comparator class="hudson.util.CaseInsensitiveComparator"/>
</default>
<int>2</int>
<string>APPLICATION_ENVIRONMENT</string>
<string>continious_integration</string>
<string>SPRING_PROFILES_ACTIVE</string>
<string>continious_integration</string>
</tree-map>
</envVars>
</hudson.slaves.EnvironmentVariablesNodeProperty>
</globalNodeProperties>
</hudson>