NuKeeper,用于在构建服务器上自动执行NuGet软件包参考更新

Last week I looked at "dotnet outdated," a super useful .NET Core Global Tool for keeping a project's NuGet packages up to date. Since then I've discovered there's a whole BUNCH of great projects solving different aspects of the "minor version problem." I love this answer "Why?" from the NuKeeper (inspired by Greenkeeper) project with emphasis mine. NuKeeper will check for updates AND try to update your references for you! Why not automate the tedious!

上周,我研究了“ dotnet过时”,这是一个超级有用的.NET Core全局工具,用于使项目的NuGet软件包保持最新。 从那以后,我发现有许多大型项目可以解决“小版本问题”的各个方面。 我喜欢这个答案“为什么?” 从NuKeeper (灵感来自Greenkeeper )项目,重点煤矿。 NuKeeper将检查更新并尝试为您更新参考! 为什么不自动化繁琐的工作!

NuGet package updates are a form of change that should be deployed, and we likewise want to change the cycle from "NuGet package updates are infrequent and contain lots of package changes, therefore NuGet package updates are hard and dangerous..." to "NuGet package updates are frequent and contain small changes, therefore NuGet package updates are easy and routine...".

NuGet软件包更新是应部署的一种更改形式,我们同样希望将周期从“ NuGet软件包更新很少且包含很多软件包更改,因此NuGet软件包更新是困难且危险的……”到“ NuGet软件包更新非常频繁,并且包含很小的更改,因此NuGet软件包更新非常容易且常规……”。

Certainly no one is advocating updating the major versions of your dependent NuGet packages, but small compatible bug fixes come often and are often missed. Including a tool to discover - and optionally apply - these changes in a CI/CD (Continuous Integration/Continuous Deployment) pipeline can be a great timesaver.

当然,没有人提倡更新依赖的NuGet软件包的主要版本,但是兼容的小错误修复程序经常出现并且经常被遗漏。 在CI / CD(连续集成/连续部署)管道中包括发现并选择应用这些更改的工具可以节省大量时间。

Why do we deploy code changes frequently but seldom update NuGet packages?

为什么我们经常部署代码更改,却很少更新NuGet软件包

Good question!

好问题!

NuKeeper (NuKeeper)

NuKeeper is a .NET tool as well that you can install safely with:

NuKeeper也是一个.NET工具,您可以使用以下工具安全安装:

dotnet tool install --global NuKeeper

Here it is running on my regularly updated podcast website that is running ASP.NET Core 2.1:

在这里,它在运行ASP.NET Core 2.1的我的定期更新的播客网站上运行:

NuKeeper says I have 3 packages to update

Looks like three of my packages are out of date. NuKeeper shows what version I have and what I could update to, as well as how long an update has been available.

看来我的三个包裹已经过时了。 NuKeeper会显示我拥有的版本以及可以更新到的版本,以及可用更新的时间。

You can also restrict your updates by policy, so "age=3w" for packages over 3 weeks old (so you don't get overly fresh updates) or "change=minor" or "change=patch" if you trust your upstream packages to not break things in patch releases, etc.

您还可以根据政策限制更新,因此对于超过3周的旧软件包,请“ age = 3w”(这样就不会获得过多的新更新);如果您信任上游软件包,则可以“ change = minor”或“ change = patch”不破坏修补程序发行版等中的内容

NuKeeper is picking up steam and while (as of the time of this writing) its command line parameter style is a little unconventional, Anthony Steele and the team is very open to feedback with many improvements already in progress as this project matures!

NuKeeper正在加速发展,尽管(在撰写本文时)它的命令行参数样式有点不合常规,随着该项目的成熟,Anthony Steele和团队非常乐意接受反馈,已进行许多改进

The update functionality is somewhat experimental and currently does 1 update per local run, but I'm really enjoying the direction NuKeeper is going!

更新功能在某种程度上是试验性的,当前每次本地运行都会进行1次更新,但是我真的很喜欢NuKeeper的发展方向!

通过拉取请求自动更新NuGet (Automatic NuGet Updates via Pull Request)

NuKeeper has a somewhat unique and clever feature called Repository Mode in that it can automatically issue a Pull Request against your repository with the changes needed to update your NuGet references. Check out this example PullRequest!

NuKeeper具有一个称为“存储库模式”的有点独特和巧妙的功能,它可以自动向您的存储库发出“拉取请求”,其中包含更新NuGet引用所需的更改。 看看这个例子PullRequest

Anthony - the lead developer - points out that ideally you'd set up NuKeeper to send PRs for you. Automatic PRs are NuKeepers primary goal and use case!

首席开发人员Anthony指出,理想情况下,您应该设置NuKeeper为您发送PR。 自动PR是NuKeepers的主要目标和用例!

The NuKeeperBot has automatically issued a PR with a list of packages to update

Again, it's early days, but between NuKeeper and "dotnet outdated," I'm feeling more in control of my package references than ever before! What are YOU using?

再说一次,这是早期,但是在NuKeeper和“ dotnet过时”之间,我比以往任何时候都更能控制我的软件包引用! 您正在使用什么?

翻译自: https://www.hanselman.com/blog/nukeeper-for-automated-nuget-package-reference-updates-on-build-servers

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值