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

[Question] Assign MASTER role

XMLWordPrintable

      I'm running Jenkins ver. 2.73.3, master with multiple Linux slaves,
      postbuildscript-plugin version 0.17.

      I'm using postbuildscript plugin to tag my GitHub repo when the build successful completes:

      git tag -a -f -m "release on $(date)" ${BUILD_NUMBER}
      git push GithubRepo ${BUILD_NUMBER}
      

      Attaching screenshot of the working conf.

      After updating to 2.5.0 the tagging script isn't working, tried changing the Execute script on Master I get:

      [ssh-agent] Stopped.
       [PostBuildScript] - Executing post build scripts.
       [PostBuildScript] - Node does not have the role MASTER. Did not execute build step #0.
      Sending e-mails to: dev@mycompany.com
      Finished: SUCCESS
      

      Tried to have the execution on the Slave I get the following error:

      [ssh-agent] Stopped.
       [PostBuildScript] - Executing post build scripts.
       [builder-backend-j8] $ /bin/bash /tmp/jenkins4390017699665485219.sh
      git tag -a -f -m 'release on Wed Feb 14 23:57:34 UTC 2018' 754
      git push FGithubRepo 754
      Permission denied (publickey).
      fatal: Could not read from remote repository.
      
      Please make sure you have the correct access rights
      and the repository exists.
      Build step 'Execute Scripts' changed build result to FAILURE
      Build step 'Execute Scripts' marked build as failure
      Sending e-mails to: dev@mycompany.com
      Finished: FAILURE
      

      In this case, I believe the error exists because the ssh-agent isn't present at this step on the slave.

      Using version 0.17, using MATRIX config I get the Github repo properly tagged:

      > git rev-list --no-walk 4e8177475488332a275d42a84329404ae4db8c18 # timeout=10
      Triggering app » builder
      app » builder completed with result SUCCESS
       [PostBuildScript] - Execution post build scripts.
       [workspace] $ /bin/bash /tmp/jenkins2029997385938416345.sh
      git tag -a -f -m 'release on Thu Feb 15 00:39:55 UTC 2018' 762
      git push GithubRepo 762
      To github.com:comapany/app.git
       * [new tag] 762 -> 762
      Finished: SUCCESS
      

      This works (i believe) because the script runs on master, and the Github credentials are available.

      How can I tag the master node in a way to fix this:

      [PostBuildScript] - Node does not have the role MASTER. Did not execute build step #0.
      

      I already tried to add a tag in the node config but it didn't work.

        1. JENKINS-49585.png
          JENKINS-49585.png
          57 kB
        2. JENKINS-495585-output.png
          JENKINS-495585-output.png
          61 kB
        3. img1.png
          img1.png
          56 kB

            dheid Daniel Heid
            ltagliamonte Luigi Tagliamonte
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: