Jenkins Cookbook

Jenkins 的安装

1. 选择合适的版本: Installing Jenkins

2. 插件的安装:Managing Plugins

Web UI 使用 "插件管理器"。
使用 Jenkins CLI install-plugin 命令。

  • 除了以上官方推荐的两种方式,Advanced Installation 无疑是解决 Plugin 版本不匹配的最佳方案:
  1. Web UI 中导航到 Manage Jenkins > Manage Plugins 页面。

  2. 点击 Advanced 选项卡。

  3. 选择 Upload Plugin 部分下面的 .hpi 文件。

  4. Upload 插件文件。

    Dashboard View 为例:
    首先在 Plugins Index 页搜索 Dashboard View

    然后选择 Dashboard View 切换到 Release 选项卡,根据 Maintenance 信息选择适合的版本(.hpi 文件)下载;

    最后按照 Advanced Installation 方式操作。

Jenkins 的系统属性

Jenkins Features Controlled with System Properties

Configuring Content Security Policy

System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "sandbox; default-src 'self';")
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "")
System.clearProperty("hudson.model.DirectoryBrowserSupport.CSP")
System.getProperty("hudson.model.DirectoryBrowserSupport.CSP")

Jenkins Plugin Dashboard View

【需求】Dashboard 中嵌入 测试环境 选项卡。
【方案】 使用 Dashboard View 中的 IFrame Portlet 扩展。
【问题】 测试环境 中包含的 Jenkins 项目编译链接可能失效。
【解决及原因】 http => https Secure Contexts

posted @ 2023-02-01 20:02  Ying‘s  阅读(29)  评论(0编辑  收藏  举报