nuget 构建自己的包_托管您自己的NuGet服务器和Feed以使用BaGet构建构件
nuget 构建自己的包
NuGet is the package management system underlying the .NET programming platform. Just like Ruby Gems or NPM Packages, you can bring in 3rd party packages or make your own. The public repository is hosted at http://nuget.org BUT the magic is that there's alternatives! There are lots of alternative servers, as well as alterative clients like Paket.
NuGet是.NET编程平台基础的程序包管理系统。 就像Ruby Gems或NPM包一样,您可以引入第三方包或自己制作。 公共存储库托管在http://nuget.org,但是神奇的是,还有其他选择! 有很多替代服务器,以及Paket等替代客户端。
There's a whole ecosystem of NuGet servers. You can get filtered views, authenticated servers, special virus scanned repositories, your own custom servers where your CI/CD (Continuous Integration/Continuous Deployment) system can publish daily (hourly?) NuGet packages for other teams to consume.
有一个完整的NuGet服务器生态系统。 您可以获取筛选视图,经过身份验证的服务器,经过特殊病毒扫描的存储库,您自己的自定义服务器,您的CI / CD(持续集成/持续部署)系统可以在其中每天(每小时一次)发布NuGet包,以供其他团队使用。
Ideally in a team situation you'll have one team produce NuGet Packages and publish them to a private NuGet feed to be consumed by other teams.
理想情况下,在团队中,您将让一个团队生成NuGet程序包并将其发布到私有的NuGet提要中,以供其他团队使用。
Here's just a few cool NuGet servers or views on NuGet.org:
以下是一些不错的NuGet服务器或NuGet.org上的视图:
-
-
FuGet is "pro nuget package browsing!" Creating by the amazing Frank A. Krueger - of whom I am an immense fan - FuGet offers a different view on the NuGet package library. NuGet is a repository of nearly 150,000 open source libraries and the NuGet Gallery does a decent job of letting one browse around. However, https://github.com/praeclarum/FuGetGallery is an alternative web UI with a lot more depth.
FuGet是“专业nuget包浏览”! 由惊人的Frank A. Krueger (我是一位超级粉丝)创建的Fufu在NuGet包库上提供了不同的视图。 NuGet是一个将近15万个开放源代码库的存储库,NuGet Gallery的浏览器工作相当不错。 但是, https://github.com/praeclarum/FuGetGallery是替代Web UI,具有更深的深度。
-
-
- Artifactory is a, ahem, factory for build artifacts of all flavors, NuGet being just one of them. You can even make your own internal cache of NuGet.org. You can remove or block access to packages you don't want your devs to have. Artifactory是一家制造各种口味的人工制品的工厂,NuGet只是其中之一。 您甚至可以创建自己的NuGet.org内部缓存。 您可以删除或阻止对您不希望开发人员拥有的软件包的访问。
-
- You can just run your OWN instance of the NuGet.org website! It's open source 您可以只运行NuGet.org网站的OWN实例! 它是开源的
-
-
NuGet.Server is an MVP (Minimum Viable Product) of a NuGet Server. It's small and super lightweight but it's VERY limited. Consider using BaGet (below) instead.
NuGet.Server是NuGet服务器的MVP(最低可行产品)。 它虽小又轻巧,但是非常有限。 考虑改用BaGet (如下)。
-
-
- GitHub has a package repository with a small free tier, and it also scales up to Enterprise size if you want a "SaaS" offering (software as a service)GitHub的软件包存储库带有一个免费的小型存储层,如果您需要“ SaaS”产品(软件即服务),它也可以扩展到企业规模。
-
- Azure Artifacts can also provide a SaaS setup for your NuGet packages. Set it up and forget it. A simple place for your automated build to drop your build artifacts. Azure Artifacts还可以为您的NuGet包提供SaaS设置。 设置并忘记它。 自动构建的简单位置,用于放置构建工件。
- MyGet can hold packages of all kinds, including NuGet.They are well known for their license compliance system, so you can make sure your devs and enterprise are only using the projects your org can support.\ MyGet可以容纳包括NuGet在内的各种软件包。它们以其许可证合规系统而闻名,因此您可以确保您的开发人员和企业仅使用组织可以支持的项目。\
- Sleet is a NuGet v3 static feed generator. It's a Nuget Server, that's totally STATIC. Just like a static site generator this means that you can make feeds and host them directly on Azure Storage or Amazon S3 with no compute required. Sleet是NuGet v3静态供稿生成器。 这是一台Nuget服务器,完全是静态的。 就像静态网站生成器一样,这意味着您可以制作提要并将其直接托管在Azure存储或Amazon S3上,而无需计算。
-
- A NuGet server with a Linux-first approach采用Linux优先方法的NuGet服务器
-
BaGet (pronounced baguette)
BaGet (发音为法式面包)
-
This is one of my favorites. It's a new fresh NuGet server written entirely in ASP.NET Core 3.1. It's cross platform, open source, and runs in Azure, AWS, Google Cloud, behind IIS, or via Docker. Lovely! It's also a great example of some thoughtfully architected code, good plugin model, nice separation of concerns, and a good test suite. If you are using NuGet.Server now, move over to BaGet!
这是我的最爱之一。 它是完全用ASP.NET Core 3.1编写的新的新NuGet服务器。 它是跨平台的开源软件,可在Azure,AWS,Google Cloud,IIS或Docker下运行。 可爱! 这也是一些精心设计的代码,良好的插件模型,良好的关注点分离和良好的测试套件的一个很好的例子。 如果您现在正在使用NuGet.Server,请移至BaGet !
BaGet (pronounced baguette)
BaGet (发音为法式面包)
-
Let's focus on BaGet for now! Go give them some love/stars on GitHub!
现在让我们专注于BaGet! 在GitHub上给他们一些爱/星星!
使用BaGet设置跨平台的个人NuGet服务器 (Setting up a cross platform personal NuGet Server with BaGet)
BaGet is a lovely little server. So far it supports:
BaGet是一个可爱的小服务器。 到目前为止,它支持:
- Cross-platform 跨平台
-
Can index the entirety of nuget.org. See this documentation
可以索引整个nuget.org。 请参阅此文档
- Coming soon: Will supports private feeds即将推出:将支持私人供稿
The most initially powerful feature in my opinion is the Read-through caching.
我认为最强大的功能是直读缓存。
This lets you index packages from an upstream source. You can use read-through caching to:
这使您可以从上游源索引软件包。 您可以使用通读缓存执行以下操作:
-
Speed up your builds if restores from nuget.org are slow
- Enable package restores in offline scenarios在离线情况下启用程序包还原
This can be great for folks on low bandwidth or remote scenarios. Put BaGet in front of your developers and effectively make a NuGet "edge CDN" that's private to you.
这对于带宽较低或偏远情况的人们来说非常有用。 将BaGet放在开发人员的面前,并有效地制作对您私有的NuGet“ edge CDN”。
If you are familiar with Docker, you can get a BaGet NuGet server up in minutes. You can also use Azure or AWS or another cloud to store your artifacts in a scaleable way.
如果您熟悉Docker,则可以在数分钟内启动BaGet NuGet服务器。 您还可以使用Azure或AWS或其他云以可扩展的方式存储工件。
NOTE: You'll notice that the docs for things like "running BaGet on Azure" aren't complete. This is a great opportunity for YOU to help out and get involved in open source! Note that BaGet has a number of open issues on their GitHub *and* they've labeled some as "Good First Issue!"
注意:您会注意到,诸如“在Azure上运行BaGet ”之类的文档尚不完善。 这是您帮助并参与开源的绝佳机会! 请注意,BaGet在其GitHub上有许多未解决的问题*,并且*他们已将它们标记为“ Good First Issue !”。
If you want to try running BaGet without Docker, just
如果您想尝试在没有Docker的情况下运行BaGet,只需
-
Install .NET Core SDK
-
Download and extract BaGet's latest release
下载并提取BaGet的最新版本
-
Start the service with
dotnet BaGet.dll
用
dotnet BaGet.dll
启动服务 -
Browse
http://localhost:5000/
in your browser在浏览器中浏览
http://localhost:5000/
That's it! All the details on Getting Started with BaGet are on their GitHub. Go give them some love and stars.
而已! BaGet入门的所有详细信息都在其GitHub上。 去给他们一些爱和星星。
关于斯科特 (About Scott)
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
斯科特·汉塞尔曼(Scott Hanselman)是前教授,前金融首席架构师,现在是演讲者,顾问,父亲,糖尿病患者和Microsoft员工。 他是一位失败的单口相声漫画家,一个玉米种植者和一本书的作者。
翻译自: https://www.hanselman.com/blog/hosting-your-own-nuget-server-and-feed-for-build-artifacts-with-baget
nuget 构建自己的包