I am trying to set environment variables with EC2s user data, but nothing i do seems to work
here are the User data scripts i tried
#!/b
Adding this to the init script of the node will add environment variables on launch. They won't show up in the node configuration page but they will be able to use in any job.
#!/bin/bash
echo 'JAVA_HOME="/usr/lib/jvm/java-8-oracle/"' | sudo tee -a /etc/profile#
This answer is similar to what hamx0r proposed however, jenkins doesn't have permission to echo to /etc/profiles with or without sudo.