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

Ability to use environment variables in server url, topic and message of the mqtt publisher plugin

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Can we have a new feature in mqtt notification plugin to be able to use the job's environment variables in MQTT server parameters, the topic and within the message?

        Attachments

          Activity

          sradhakrishna Radha Krishna Srimanthula created issue -
          gareth_western Gareth Western made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          gareth_western Gareth Western added a comment -

          Sounds like a good idea. I'll start looking in to it.

          Show
          gareth_western Gareth Western added a comment - Sounds like a good idea. I'll start looking in to it.
          Hide
          gareth_western Gareth Western added a comment - - edited

          I've made this change so that environment variables can be used in both the topic and the message.

          This will be available in v1.3

          What did you mean by the server parameters? I guess e.g. the hostname?

          If this is required then let me know and i'll make a minor release to include that.

          Show
          gareth_western Gareth Western added a comment - - edited I've made this change so that environment variables can be used in both the topic and the message. This will be available in v1.3 What did you mean by the server parameters? I guess e.g. the hostname? If this is required then let me know and i'll make a minor release to include that.
          gareth_western Gareth Western made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Resolved [ 5 ]
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Gareth Western
          Path:
          src/main/java/jenkins/plugins/mqttnotification/MqttNotifier.java
          src/main/resources/jenkins/plugins/mqttnotification/MqttNotifier/help-message.html
          src/main/resources/jenkins/plugins/mqttnotification/MqttNotifier/help-topic.html
          http://jenkins-ci.org/commit/mqtt-notification-plugin/a344095d61e5621e78bccf1f2f5b240358be616f
          Log:
          JENKINS-31669 Substitute environment variables in topic / payload

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gareth Western Path: src/main/java/jenkins/plugins/mqttnotification/MqttNotifier.java src/main/resources/jenkins/plugins/mqttnotification/MqttNotifier/help-message.html src/main/resources/jenkins/plugins/mqttnotification/MqttNotifier/help-topic.html http://jenkins-ci.org/commit/mqtt-notification-plugin/a344095d61e5621e78bccf1f2f5b240358be616f Log: JENKINS-31669 Substitute environment variables in topic / payload
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 167106 ] JNJira + In-Review [ 198117 ]
          Hide
          mhuin Matthieu Huin added a comment -

          Hello,

          I'm using Jenkins 1.651.3. I've been trying to use this plugin to display environment variables in the mQTT message, for example:

          $HOME
          $NODE_NAME

          and even parameters from the job, which appear if I add the "env" command in the job. Only the predefined variables $PROJECT_URL and $BUILD_RESULT are correctly replaced. Am I doing something incorrectly?

          Show
          mhuin Matthieu Huin added a comment - Hello, I'm using Jenkins 1.651.3. I've been trying to use this plugin to display environment variables in the mQTT message, for example: $HOME $NODE_NAME and even parameters from the job, which appear if I add the "env" command in the job. Only the predefined variables $PROJECT_URL and $BUILD_RESULT are correctly replaced. Am I doing something incorrectly?
          gareth_western Gareth Western made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            sradhakrishna Radha Krishna Srimanthula
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: