[JIRA] (JENKINS-50167) Add support for environment variables

4 views
Skip to first unread message

dacboy@gmail.com (JIRA)

unread,
Mar 14, 2018, 9:04:04 AM3/14/18
to jenkinsc...@googlegroups.com
David Sabin created an issue
 
Jenkins / Improvement JENKINS-50167
Add support for environment variables
Issue Type: Improvement Improvement
Assignee: Aleksi Simell
Components: influxdb-plugin
Created: 2018-03-14 13:03
Priority: Minor Minor
Reporter: David Sabin

Add the ability to use environment variables for the Custom Prefix and Custom Project Name.  I'm trying to make a job that haves a parameter variable unique to a person using it, and I'd like that variable to be added as the prefix tag to the InfluxDB also, so the user can filter on their data in the database.  This makes it more dynamic for having multiple users of the same Jenkins job.

See https://stackoverflow.com/questions/30512887/variable-substitution-in-jenkins-plugin for some details.

My thought is that adding the following lines to the beginning of InfluxDbPublisher.java:perform()

final EnvVars env = build.getEnvironment(listener);

String expandedCustomPrefix = env.expand(customPrefix);

String expandedCustomProjectName = env.expand(customProjectName);

Then use the new expanded variables for the rest of the function.I don't exactly know how to get the build and listener variables correct, but the link above should help.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

aleksi.simell@eficode.com (JIRA)

unread,
Jun 27, 2019, 2:42:02 AM6/27/19
to jenkinsc...@googlegroups.com
Aleksi Simell updated Improvement JENKINS-50167
 

Feature implemented. Will be available in next release.

Change By: Aleksi Simell
Status: Open Fixed but Unreleased
Resolution: Done
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

aleksi.simell@eficode.com (JIRA)

unread,
Aug 5, 2019, 1:30:02 AM8/5/19
to jenkinsc...@googlegroups.com
Change By: Aleksi Simell
Status: Fixed but Unreleased Closed
Released As: 1.23
Reply all
Reply to author
Forward
0 new messages