如何永久解决Jenkins中显示范围报告的HTML Publisher插件问题? [英] How to Permanently Resolve HTML Publisher Plugin issue in Jenkins showing Extent Reports?

查看:220
本文介绍了如何永久解决Jenkins中显示范围报告的HTML Publisher插件问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用HTML发布的插件在Jenkins中发布范围报告,结果不会以正确的格式显示.

Publishing Extent Reports in Jenkins using HTML Published Plugin, the results do not display in a proper format.

要解决此问题,请在脚本控制台中运行此命令,它可以正常运行:

To resolve this issue, running this command in the Script Console, it started working fine:

System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "default-src * 'unsafe-inline' 'unsafe-eval'; script-src * 'unsafe-inline' 'unsafe-eval'; connect-src * 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src *; style-src * 'unsafe-inline';")

一旦Jenkins重新启动,就会发生相同的问题.在这种情况下,我必须每次都使用此代码.请指导我如何永久设置代码.

Once Jenkins is restarted, the same issue happened. In this case, I have to use this code each time. Please guide me on how can I set up the code permanently.

推荐答案

在脚本控制台中运行此类命令时,它们只会影响正在运行的会话,并且在重新启动后会丢失,恢复为存储的设置/配置.

When you run such commands in the script console they only affect the running session and will be lost on a restart reverting to the stored settings /configuration.

根据您启动Jenkins的方式以及最方便的方式,有多种选择可以使它们成为永久性".

There are various options available to you make them "permanent", depending on how you launch your Jenkins and what's most convenient to you.

这篇文章介绍了在jenkins脚本中将它们设置为 JENKINS_JAVA_OPTIONS .

This post describes setting them as JENKINS_JAVA_OPTIONS in the jenkins script.

您可以将它们作为java启动命令中的命令行选项传递给

You can pass them in as command line options in the java launch command as shown in the top of the Features controlled by system properties (Make sure to pass all of these arguments before the -jar argument, otherwise they will be ignored).

您可以使用后初始化脚本. $ {JENKINS_HOME}/init.groovy中的文件或$ {JENKINS_HOME}/init.groovy.d/*.groovy中的文件

You can use a groovy Post-initialization script. in ${JENKINS_HOME}/init.groovy or a file in ${JENKINS_HOME}/init.groovy.d/*.groovy

您应该牢记,更改 CSP设置可能潜在地将您的Jenkins 实例暴露给外部风险-阅读.尽管最近对Jenkins代码进行了增强以使其更安全,但仍然存在很多隐患,尤其是在无数的插件中.您应该只允许使插件正常工作所需的最低数量.

You should bear in mind, changing the CSP settings potentially exposes your Jenkins instance to external risks - READ UP. While the Jenkins code has been recently strengthened to make it more secure, there's a lot of exposure left, especially in the myriad of plugins out there. You should only allow the minimum amount needed to get the plugin working.

如果各个插件提供者都详细说明了允许其插件正常运行并仍保持Jenkins尽可能安全的最佳方式,那将是很好的选择.考虑在 http://issues.jenkins-ci.org/上针对该插件提高门票问题.

It would be nice if the various plugin providers detailed exactly what must be allowed to have their plugin working properly and still keep Jenkins as secure as possible. Consider raising a ticket at http://issues.jenkins-ci.org/ against the plugin in question.

这篇关于如何永久解决Jenkins中显示范围报告的HTML Publisher插件问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆