Jenkins 笔记

1. Jenkins 笔记

1.1. 插件

Jenkins 的插件设计非常糟糕, 依赖关系非常乱, 不同插件间非常容易不兼容, 一般采用 docker 方式单独挂载插件。

My experience has been that I need to specify the precise version of all the plugins, otherwise the dependency resolution process in the plugin installation manager tool will install versions that I don’t recognize. Your yaml file seems to specify a few key plugins and then relies on the dependency management system to resolve the other dependencies.

I created a plugins.txt for the current installation with the script from the “How to report an issue” page 4. That script looks like this (run from in the Jenkins script console):

Jenkins.instance.pluginManager.plugins
    .collect()
    .sort { it.getShortName() }
    .each {
        plugin -> println("${plugin.getShortName()}:${plugin.getVersion()}")
    }
return

Once that is stored as plugins.txt, then I use the following command to periodically check for updates to the plugins as defined in the plugins.txt file.

$ ./jenkins-plugin-cli.sh --jenkins-version 2.319.3 \
  --plugin-download-directory ref/plugins \
  --plugin-file plugins.txt \
  --no-download \
  --available-updates \
  --output txt > x && mv x plugins.txt
$ ./jenkins-plugin-cli.sh --jenkins-version 2.319.3 \
  --plugin-download-directory ref/plugins \
   --plugin-file plugins.txt

That sequence of commands first checks for available updates and prepares a new plugins.txt file, then downloads the plugins to match the new plugins.txt file. I’ve preferred to store my plugin binary files and the plugins.txt file as large files in a Git repository. I did that because I needed an excuse to use large file storage. I don’t know that is the best solution, but it let me learn more about git LFS.

If you’d like to see the public part of that setup, see

GitHub - MarkEWaite/docker-lfs at lts-with-plugins

Docker images using large file support for binary files

That repository contains multiple Docker image definitions so that I can quickly switch from one testing setup to another testing setup. There is another repository that tracks private content using the same concepts.

1.1.1. 参考

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

云满笔记

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值