Most of our builds archive the readme and release notes as part of the build. In the past, these were mostly .txt and .html, which are served in the browser just fine when clicked (we have the resource root URL configured as well).
However, we’re switching to MarkDown for most of these files, and Jenkins is not serving those as content, instead causing them to be downloaded.
I don’t see any immediate configuration for this in the UI - where do I go to tell Jenkins to serve .md files as text/markdown?
Note: running Jenkins on RHEL using the official packages, so hosted in Jetty; I assume it’s a Jetty configuration thing, but not sure where to put a file (especially in a way that persists across package updates).
I think you may be expecting Jenkins to render the markdown formatted archived artifact as HTML in the browser. Jenkins doesn’t do that as far as I know.
I created a Declarative Pipeline that archived some output as a markdown file like this:
No, that is not what I expect, not in the sense that Jenkins does this anyway.
For an HTML file, clicking view shows the HTML source, and clicking the file serves it using the resource root URL, letting the browser apply its rendering to it.
For the MarkDown file, view behaves the same way (showing the raw contents), but clicking triggers a download, not a serving of the file on the resource root URL. We have a browser plugin for rendering MarkDown, but that does not get a chance to be applied this way.
Or, perhaps more accurately, the .md file may be served on the resource root URL by Jetty, but it decides it doesn’t know its mime type, resulting in the download.
I’m sure that will be configurable (i.e. telling Jetty that .md files are text/markdown), but with Jetty being bundled, I am not sure where that config would go, and whether it would need reapplying after every package upgrade.
If there is a jenkins package for use with Apache HTTPD that might be an alternative, but having to do a full Apache setup just for this one thing seems overkill.