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

Email Template Testing can't find passed Jelly script file

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • email-ext-plugin
    • None
    • OS: Windows 7
      Jenkins: 1.516
      Email-ext: 2.30.2

    Description

      Newly implemented Email Template Testing feature doesn't work for Jelly scripts.

      If name of template file is passed with extension following error occurs:

      Jelly script [myscript.jelly] was not found in $JENKINS_HOME/email-templates.

      If name of template file is passed without extension following error occurs:

      Template [myscript] was not found in $JENKINS_HOME/email-templates.

      additionally a validation error is shown:

      The file 'myscript' does not exist

      The problem is that EmailExtTemplateAction.doTemplateFileCheck() and EmailExtTemplateAction.renderTemplate() methods expect that template name includes extension. But JellyScriptContent.getTemplateInputStream() expects that template name doesn't contains extension.

      Attachments

        Activity

          slide_o_mix Alex Earl added a comment -

          Email-ext uses that plugin to allow users to store templates inside Jenkins. You would want this plugin https://wiki.jenkins-ci.org/display/JENKINS/Managed+Script+Plugin for the GUI to manage the files.

          slide_o_mix Alex Earl added a comment - Email-ext uses that plugin to allow users to store templates inside Jenkins. You would want this plugin https://wiki.jenkins-ci.org/display/JENKINS/Managed+Script+Plugin for the GUI to manage the files.
          thekbb Kevin Behrens added a comment - - edited

          @Alex Earl , Can you expound upon using he 'config file plugin to contain your templates'? This sounds like sauce I need to have.

          Were you referring to the Config+File+Provider+Plugin? From the wiki, it say it

          Adds the ability to provide configuration files (i.e., settings.xml for maven, XML, groovy, custom files, etc.) loaded through the Jenkins UI which will be copied to the job's workspace.

          I am missing something, as that would allow me to put the template on the slave, where it won't be used.

          thekbb Kevin Behrens added a comment - - edited @Alex Earl , Can you expound upon using he 'config file plugin to contain your templates'? This sounds like sauce I need to have. Were you referring to the Config+File+Provider+Plugin ? From the wiki, it say it Adds the ability to provide configuration files (i.e., settings.xml for maven, XML, groovy, custom files, etc.) loaded through the Jenkins UI which will be copied to the job's workspace. I am missing something, as that would allow me to put the template on the slave, where it won't be used.
          slide_o_mix Alex Earl added a comment -

          Your templates should never go into the path you mention. Please review the documentation on where to put templates. With the most recent version of the plugin you can also use the managed config file plugin to contain your templates.

          slide_o_mix Alex Earl added a comment - Your templates should never go into the path you mention. Please review the documentation on where to put templates. With the most recent version of the plugin you can also use the managed config file plugin to contain your templates.

          ok I upgraded Jenkins from 1.504 to 1.546 recently and upgraded the EmailExt Plugin from 2.27.1 to what ever is available now.

          I luckily had a snapshot of the server prior to upgrade and can say that after the upgrade all my templates were missing from this path:
          C:\Jenkins\plugins\email-ext\WEB-INF\classes\hudson\plugins\emailext\templates

          So is there a proper way to upgrade this plugin without loosing my templates and the ability to send email post build?

          awilliams Angel Williams added a comment - ok I upgraded Jenkins from 1.504 to 1.546 recently and upgraded the EmailExt Plugin from 2.27.1 to what ever is available now. I luckily had a snapshot of the server prior to upgrade and can say that after the upgrade all my templates were missing from this path: C:\Jenkins\plugins\email-ext\WEB-INF\classes\hudson\plugins\emailext\templates So is there a proper way to upgrade this plugin without loosing my templates and the ability to send email post build?
          slide_o_mix Alex Earl added a comment -

          Then it some how got removed during your upgrade process, which has nothing to do with email-ext.

          slide_o_mix Alex Earl added a comment - Then it some how got removed during your upgrade process, which has nothing to do with email-ext.

          People

            slide_o_mix Alex Earl
            ddbear Volodja Medvid
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: