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

When using Jenkins DSL, global defaults don't work

    Details

    • Similar Issues:

      Description

      Hi folks,

      not sure, whether I'm at the right place to report this, but let's see.

      We're using the Jenkins DSL to create jobs via .groovy files. We have configured the RocketChat user/password/serverURL/and so on globally in Jenkins settings.

      Yet when I try to create just a test:

      [...]
               publishers {
                   rocketChatNotifier {
                      title('Moin, ich bin lpp-frontend-infrastructure')
                      text('huhu')
                      channel('#jenkins')
                      customMessage('Moin, ich bin lpp-frontend-infrastructure')
                   }
               }
      [...]
      

      I get the following error:

      Processing DSL script PROJECTNAME.groovy

      ERROR: (PROJECTNAME, line 199) the following options are required and must be specified: rocketServerUrl, trustSSL, username, password, buildServerUrl, startNotification, notifyAborted, notifyFailure, notifyNotBuilt, notifySuccess, notifyUnstable, notifyBackToNormal, notifyRepeatedFailure, includeTestSummary, commitInfoChoice, includeCustomMessage

      Finished: FAILURE

      Is this something the plugin is able to solve?

      Cheers
      Thomas

        Attachments

          Activity

          Hide
          twizzydizzy TwizzyDizzy TwizzyDizzy added a comment -

          Erm. So do we do anything wrong, Martin Reinhardt, or what is the reason for closing this issue? An explanation would be a nice thing

          Cheers
          Thomas

          Show
          twizzydizzy TwizzyDizzy TwizzyDizzy added a comment - Erm. So do we do anything wrong, Martin Reinhardt , or what is the reason for closing this issue? An explanation would be a nice thing Cheers Thomas
          Hide
          thaipham Thai Pham added a comment -

          I used the same code as TwizzyDizzy TwizzyDizzy was using:

              publishers {
                  rocketChatNotifier {
                      channel '#jenkins'
                      includeTestSummary false
                      notifyAborted true
                      notifyBackToNormal true
                      notifyFailure true
                      notifyNotBuilt true
                      notifyRepeatedFailure true
                      notifySuccess true
                      notifyUnstable true
                      startNotification true
                  }
              }
          

          and got a similar error message:

          ERROR: (ci.groovy, line 103) the following options are required and must be specified: rocketServerUrl, trustSSL, username, password, buildServerUrl, includeTestSummary, commitInfoChoice, includeCustomMessage, customMessage, webhookToken, tokenCredentialId
          
          Show
          thaipham Thai Pham added a comment - I used the same code as TwizzyDizzy TwizzyDizzy was using: publishers { rocketChatNotifier { channel '#jenkins' includeTestSummary false notifyAborted true notifyBackToNormal true notifyFailure true notifyNotBuilt true notifyRepeatedFailure true notifySuccess true notifyUnstable true startNotification true } } and got a similar error message: ERROR: (ci.groovy, line 103) the following options are required and must be specified: rocketServerUrl, trustSSL, username, password, buildServerUrl, includeTestSummary, commitInfoChoice, includeCustomMessage, customMessage, webhookToken, tokenCredentialId
          Hide
          thaipham Thai Pham added a comment -

          Martin Reinhardt, I'm using 1.1.1.

          Show
          thaipham Thai Pham added a comment - Martin Reinhardt , I'm using 1.1.1.
          Hide
          mreinhardt Martin Reinhardt added a comment -

          which plugin version you're using?

          Show
          mreinhardt Martin Reinhardt added a comment - which plugin version you're using?
          Hide
          thaipham Thai Pham added a comment -

          I'm also experiencing the same problem. Is there any plan to fix it?

          Thanks,

          Thai

          Show
          thaipham Thai Pham added a comment - I'm also experiencing the same problem. Is there any plan to fix it? Thanks, Thai
          Hide
          twizzydizzy TwizzyDizzy TwizzyDizzy added a comment -

          Hi Martin Reinhardt,

          tried your build... jenkins user/password/server have been configured globally.

          Jenkins DSL used

              publishers {
                  rocketChatNotifier {
                      channel('#jenkins')
                      includeTestSummary(false)
                      notifyAborted(true)
                      notifyBackToNormal(true)
                      notifyFailure(true)
                      notifyNotBuilt(true)
                      notifyRepeatedFailure(true)
                      notifySuccess(true)
                      notifyUnstable(true)
                      startNotification(true)
                  }
              }
          

          The build of the job from the groovy file now works, yet after sending

          deploy PROJECT to dev - #19 Success after 19 sec

          to the #jenkins channel, there is a Null pointer exception:

          ERROR: Build step failed with exception
          java.lang.NullPointerException
          	at jenkins.plugins.rocketchatnotifier.ActiveNotifier.completed(ActiveNotifier.java:107)
          	at jenkins.plugins.rocketchatnotifier.RocketChatNotifier.perform(RocketChatNotifier.java:289)
          	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
          	at hudson.model.Build$BuildExecution.post2(Build.java:186)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
          	at hudson.model.Run.execute(Run.java:1753)
          	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          	at hudson.model.ResourceController.execute(ResourceController.java:98)
          	at hudson.model.Executor.run(Executor.java:405)
          Build step 'RocketChat Notifications' marked build as failure
          Finished: FAILURE
          

          Cheers
          Thomas

          Show
          twizzydizzy TwizzyDizzy TwizzyDizzy added a comment - Hi Martin Reinhardt , tried your build... jenkins user/password/server have been configured globally. Jenkins DSL used publishers { rocketChatNotifier { channel( '#jenkins' ) includeTestSummary( false ) notifyAborted( true ) notifyBackToNormal( true ) notifyFailure( true ) notifyNotBuilt( true ) notifyRepeatedFailure( true ) notifySuccess( true ) notifyUnstable( true ) startNotification( true ) } } The build of the job from the groovy file now works, yet after sending deploy PROJECT to dev - #19 Success after 19 sec to the #jenkins channel, there is a Null pointer exception: ERROR: Build step failed with exception java.lang.NullPointerException at jenkins.plugins.rocketchatnotifier.ActiveNotifier.completed(ActiveNotifier.java:107) at jenkins.plugins.rocketchatnotifier.RocketChatNotifier.perform(RocketChatNotifier.java:289) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720) at hudson.model.Build$BuildExecution.post2(Build.java:186) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665) at hudson.model.Run.execute(Run.java:1753) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:405) Build step 'RocketChat Notifications' marked build as failure Finished: FAILURE Cheers Thomas
          Show
          mreinhardt Martin Reinhardt added a comment - you can try the hpi from here:  https://martinreinhardt-online.de/jenkins/job/rocketchatnotifier-plugin/job/feature-feature%252F48486_defaults_dsl/lastSuccessfulBuild/artifact/target/
          Hide
          twizzydizzy TwizzyDizzy TwizzyDizzy added a comment -
          Show
          twizzydizzy TwizzyDizzy TwizzyDizzy added a comment - Goes in the direction of: https://github.com/jenkinsci/slack-plugin/issues/232

            People

            • Assignee:
              mreinhardt Martin Reinhardt
              Reporter:
              twizzydizzy TwizzyDizzy TwizzyDizzy
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: