Closed swapnil-kotwal-sp closed 4 years ago
Looks like your groovy code to get environment variables is not correct. First of all if you have a complex expression you need to use curly brakets in your string interpolation: "${System.env.GIT_GITHUB_USERNAME}"
. Though I don't think you need to use string interpolation at all here.
My another concern is with the way you are accessing env variable. I think it should be something like this instead: System.getenv()['GIT_GITHUB_USERNAME']
.
Also note that you can just use authGroup
parameter in this case, like this: authGroup 'github'
. This way the plugin will automatically look for GIT_GITHUB_USERNAME and GIT_GITHUB_PASSWORD env variables.
Perfect!!!, I was looking for authGroup 'github'
My initial impression was, this plugin will automatically read the ENV variables directly, i.e without authGroup
e.g. GIT_GITHUB_USERNAME
Thanks for the help 🙏🏻
I read the README but it still unclear how can I use the Environment variables.
Is it right approach, as by default it doesn't pick-up the environment variable credentials ? Can you please help me what am I missing here?