• Icon: Improvement Improvement
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • email-ext-plugin
    • None

      For convenience and maintenance reason it would be good to have additional possibility to configure Default Pre-send Script as an external resource.

          [JENKINS-27523] External Default Pre-send Script

          Latest version 2.40.4
          Jenkins 1.596.2

          Grzegorz Kotarski added a comment - Latest version 2.40.4 Jenkins 1.596.2

          Alex Earl added a comment -

          Can you take a screenshot of your config, or upload the global email-ext configuration xml file from JENKINS_HOME?

          Alex Earl added a comment - Can you take a screenshot of your config, or upload the global email-ext configuration xml file from JENKINS_HOME?

          Grzegorz Kotarski added a comment - - edited
          <?xml version='1.0' encoding='UTF-8'?>
          <hudson.plugins.emailext.ExtendedEmailPublisherDescriptor plugin="email-ext@2.39.3">
            <useSsl>false</useSsl>
            <charset>UTF-8</charset>
            <defaultContentType>text/html</defaultContentType>
            <defaultSubject>[$BUILD_STATUS] $PROJECT_NAME - Build #$BUILD_NUMBER </defaultSubject>
            <defaultBody>${SCRIPT, template=&quot;email.template.html&quot;}</defaultBody>
            <defaultPresendScript>${SCRIPT, script=&quot;pre-send.groovy&quot;}</defaultPresendScript>
            <defaultClasspath/>
            <maxAttachmentSize>-1</maxAttachmentSize>
            <recipientList>${TEAM_CI}</recipientList>
            <defaultReplyTo></defaultReplyTo>
            <excludedCommitters></excludedCommitters>
            <overrideGlobalSettings>false</overrideGlobalSettings>
            <precedenceBulk>false</precedenceBulk>
            <debugMode>false</debugMode>
            <enableSecurity>false</enableSecurity>
            <requireAdminForTemplateTesting>false</requireAdminForTemplateTesting>
            <enableWatching>false</enableWatching>
          </hudson.plugins.emailext.ExtendedEmailPublisherDescriptor>
          

          Grzegorz Kotarski added a comment - - edited <?xml version= '1.0' encoding= 'UTF-8' ?> <hudson.plugins.emailext.ExtendedEmailPublisherDescriptor plugin= "email-ext@2.39.3" > <useSsl> false </useSsl> <charset> UTF-8 </charset> <defaultContentType> text/html </defaultContentType> <defaultSubject> [$BUILD_STATUS] $PROJECT_NAME - Build #$BUILD_NUMBER </defaultSubject> <defaultBody> ${SCRIPT, template=&quot;email.template.html&quot;} </defaultBody> <defaultPresendScript> ${SCRIPT, script=&quot;pre-send.groovy&quot;} </defaultPresendScript> <defaultClasspath/> <maxAttachmentSize> -1 </maxAttachmentSize> <recipientList> ${TEAM_CI} </recipientList> <defaultReplyTo> </defaultReplyTo> <excludedCommitters> </excludedCommitters> <overrideGlobalSettings> false </overrideGlobalSettings> <precedenceBulk> false </precedenceBulk> <debugMode> false </debugMode> <enableSecurity> false </enableSecurity> <requireAdminForTemplateTesting> false </requireAdminForTemplateTesting> <enableWatching> false </enableWatching> </hudson.plugins.emailext.ExtendedEmailPublisherDescriptor>

          Alex Earl added a comment -

          You can't use the SCRIPT token in this context, it would have to be the FILE token, which means it would have to be in your workspace.

          Alex Earl added a comment - You can't use the SCRIPT token in this context, it would have to be the FILE token, which means it would have to be in your workspace.

          Hmmm, so it is not possible to use the script outside the workspace ??

          Grzegorz Kotarski added a comment - Hmmm, so it is not possible to use the script outside the workspace ??

          Alex Earl added a comment -

          You could use the classpath setting in the global config and then import the main body of your script and run it.

          Alex Earl added a comment - You could use the classpath setting in the global config and then import the main body of your script and run it.

          Grzegorz Kotarski added a comment - - edited

          This is not a workaround for me: in the script I do some imports like "import com.sonyericsson.jenkins.plugins.bfa.model.FailureCauseBuildAction" , etc. I would have to add all necessary libraries to classpath to compile it. And I would have to compile this script to import every time it changes (script is synchronized via a version source control system)

          Grzegorz Kotarski added a comment - - edited This is not a workaround for me: in the script I do some imports like "import com.sonyericsson.jenkins.plugins.bfa.model.FailureCauseBuildAction" , etc. I would have to add all necessary libraries to classpath to compile it. And I would have to compile this script to import every time it changes (script is synchronized via a version source control system)

          Alex Earl added a comment -

          You don't need to compile the script for it to be part of the class path. Groovy scripts will be compiled on the fly when they are imported.

          Alex Earl added a comment - You don't need to compile the script for it to be part of the class path. Groovy scripts will be compiled on the fly when they are imported.

          Ahh, you're right, thanks!
          closing issue.

          Grzegorz Kotarski added a comment - Ahh, you're right, thanks! closing issue.

          workaround

          Grzegorz Kotarski added a comment - workaround

            slide_o_mix Alex Earl
            grafi71 Grzegorz Kotarski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: