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

Make the name of the node that trigger the startup job available

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I’m working on a slave reboot task that would take a node offline, wait for any running jobs to complete and then restart the computer. Once restarted and reconnected I need to bring the node back online which is where I’d like to have a job that is triggered by a node startup (using this plugin) and will run a groovy script via the "Execute Groovy Script" build step:

      jenkins = Hudson.instance
      def node = jenkins.nodes.getNode("node name").getComputer()
      if (node.isTemporarilyOffline())

      { node.setTemporarilyOffline(false, node.getOfflineCause()) }

      The two issues I have are:
      1. The plugin does not appear to provide the name of the node that triggered the job – a solution would be for the plugin to provide an environment variable that I could read within the groovy script.

      2. The "Restricted node Label" to does not support wild cards – it would be nice if there was some way I could say “run this for all nodes”, possibly by putting a * in the node label field although a work around for this would be to give all nodes a label of ONLINE which would give the desired result as long as it doesn’t break the existing label the slaves have

      The first issue is definitely the most desired, the second nice to have.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ejpenney
          Path:
          src/main/java/org/jvnet/hudson/plugins/triggers/startup/HudsonComputerListener.java
          src/main/java/org/jvnet/hudson/plugins/triggers/startup/HudsonStartupCause.java
          http://jenkins-ci.org/commit/startup-trigger-plugin-plugin/ce8a473306b6806b4cd439ca6c21facad558375c
          Log:
          Merge pull request #1 from lrobertson39/patch-1

          JENKINS-22422 - Add node to build cause

          Compare: https://github.com/jenkinsci/startup-trigger-plugin-plugin/compare/b5e9f07da0cb...ce8a473306b6

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ejpenney Path: src/main/java/org/jvnet/hudson/plugins/triggers/startup/HudsonComputerListener.java src/main/java/org/jvnet/hudson/plugins/triggers/startup/HudsonStartupCause.java http://jenkins-ci.org/commit/startup-trigger-plugin-plugin/ce8a473306b6806b4cd439ca6c21facad558375c Log: Merge pull request #1 from lrobertson39/patch-1 JENKINS-22422 - Add node to build cause Compare: https://github.com/jenkinsci/startup-trigger-plugin-plugin/compare/b5e9f07da0cb...ce8a473306b6
          Hide
          ejpenney Emory Penney added a comment -

          Fixed in 2.6.3

          Show
          ejpenney Emory Penney added a comment - Fixed in 2.6.3

            People

            • Assignee:
              ejpenney Emory Penney
              Reporter:
              andrewsumner Andrew Sumner
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: