厨师食谱交付-厨师服务器vs.artifactory + berkshelf [英] chef cookbook delivery - chef server vs. artifactory + berkshelf

查看:90
本文介绍了厨师食谱交付-厨师服务器vs.artifactory + berkshelf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的公司一直在对Chef进行大量投资.我们已经建立了一个受人尊敬的菜谱库,以使我们的基础架构自动化.我们有目的地忽略了Chef Server和菜谱共享的问题,因为我们希望首先在菜谱中获得一些关键数量,以推动我们如何解决该问题.现在我们在那里,我们正在探索各种选择.我们已经在Artifactory上进行了巨额投资,我们很高兴地使用它在Artifactory中使用nuget,ivy,maven,npm和bower存储库在Windows/.NET和Java上存储了CI系统中几乎所有内容.我一直在阅读有关该主题的文章:

My company has been making a significant investment in Chef. We've built up a respectable library of cookbooks to automate our infrastructure. We've purposefully ignored Chef Server and the problem of cookbook sharing because we wanted to get some critical mass in our cookbooks first in order to drive how we solve that. Now we are there and we're exploring options. We already have a large investment in Artifactory and we're happily using it to store pretty much everything that comes out of our CI system across Windows/.NET and Java using nuget, ivy, maven, npm and bower repositories in Artifactory. I've been reading up on SO on this topic:

在厨师仓库中管理自定义食谱

Berkshelf-api是做什么的和Chef Supermarket的功能与传统的人工仓库不同吗?

当Artfiactory中已经有通用工件服务器时,我很努力地将Chef Server视为食谱库.最适合我们当前环境的模型是从Jenkins的工作中向Artifactory发布食谱,并根据需要使用Berkshelf从那里撤下食谱.从我的阅读看来,Berkshelf可以与Artifactory进行交流,但是我还没有找到有关如何做的详细信息.到目前为止,我们遇到的每个软件包管理器都可以通过某种方式将其指向Artifactory,因此我认为这是可行的.

And I'm struggling to see the point of Chef Server as a cookbook repo when we already have a general purpose artifact server in Artfiactory. The model that fits best into our current environment would be to publish cookbooks to Artifactory from our Jenkins jobs and use Berkshelf to pull them down from there as needed. From my reading it appears Berkshelf would be able to talk to Artifactory as a source, but I've yet to find details on how to do that. Every package manager we've encountered so far has some way to point it at Artifactory so I'm assuming there is doable.

任何人都可以就如何最好地实现这一目标分享任何指导吗?任何人都可以提供有关berkshelf是否可以愉快地做到这一点的任何细节吗?

Can anyone share any guidance on how best to approach this? Can anyone provide any details on if berkshelf can do this happily?

推荐答案

今天,大多数使用Chef的人都直接从其源代码存储库中进行部署.由于您已经在使用Artifactory,因此您了解了及时保存发布记录的重要性.发布工件存储库在构建软件和将其部署到目标系统的行为之间建立了良好的区分.

Most people using chef today deploy straight from their source code repositories. Since you're already using Artifactory you understand the importance of keeping an explicit record of your release at a point in time. A release artifact repository creates a healthy division between the act of building your software and deploying it onto a target system.

仅使用厨师服务器的专用实例(以存储发行的食谱版本)即可.这种方法恰好与Berkself-api配合使用,可以让您继续使用Berkshelf作为将食谱上传到目标厨师服务器的工具.

Using a dedicated instance of chef server (to store released cookbook versions) is just an option. It's an approach that happens to play nice with Berkself-api and allows you to continue to use Berkshelf as the tool to upload cookbooks into target chef servers.

没有什么可以阻止您使用人工制品.您需要创建一个包含食谱及其所有依赖项的归档文件,berkshelf的程序包"将完成该任务.

There is nothing stopping you from using artifactory. You'll need to create an archive that contains your cookbook and all its dependencies, the berkshelf "package" does that.

berks package mycookbooks.tar.gz
mvn deploy:deploy-file \
    -Durl=$REPO_URL \
    -DrepositoryId=$REPO_ID \
    -DgroupId=org.myorg \
    -DartifactId=mycookbooks \
    -Dversion=1.2.3  \
    -Dpackaging=tar.gz \
    -Dfile=mycookbooks.tar.gz

压缩包可以用作当前厨师-单人程序的一部分,也可以选择用于填充目标厨师服务器:

The tarball can be used as part of your current chef-solo process or could optionally be used to populate a target chef server:

curl https://myrepo/org/myorg/1.2.3/mycookbooks-1.2.3.tar.gz
tar zxvf mycookbooks-1.2.3.tar.gz
knife cookbooks upload --all --environment my-prod-env

环境"选项将在厨师环境上设置食谱版本限制,如果您想确定在运行时应用了哪个版本.

The "environment" option will set the cookbook version constraints on a chef environment, useful if you want to be certain which versions are applied at run-time.

这篇关于厨师食谱交付-厨师服务器vs.artifactory + berkshelf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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