Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-50167

Add support for environment variables

    Details

    • Similar Issues:
    • Released As:
      1.23

      Description

      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.

        Attachments

          Activity

          Hide
          aleksisimell Aleksi Simell added a comment -

          Feature implemented. Will be available in next release.

          Show
          aleksisimell Aleksi Simell added a comment - Feature implemented. Will be available in next release.

            People

            • Assignee:
              aleksisimell Aleksi Simell
              Reporter:
              dacboy David Sabin
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: