OpsWorks-自定义食谱中要包含的内容 [英] OpsWorks - what to include in custom cookbook

查看:58
本文介绍了OpsWorks-自定义食谱中要包含的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是厨师和AWS OpsWorks的新手。

I'm new to chef and AWS OpsWorks.

我想创建一个自定义菜谱,以便对生产中的资产进行预编译并使用every gem设置cron作业

I want to create a custom cookbook in order to precompile assets in production and set cron jobs with the whenever gem.

我发现了一些有关预编译资产的信息,我也会弄清楚cron的一部分,但是我对自定义厨师项目的外观感到困惑。
这是一个完整的厨师个人项目,它将代替AWS OpsWorks的标准食谱,因此我将不得不从其github存储库中复制内容。
还是将我们和他们的食谱合并?如果是这样,我必须至少包含哪些目录和文件,例如

I found something about precompiling assets and I'll figure the cron part out as well, but I am confused how my custom chef project should look like. Is it a full chef solo project that will replace the standard cookbook(s) of AWS OpsWorks, thus I'll have to copy stuff from their github repo? Or will our and their cookbooks be merged? If so, what directories and files do I have to include as a bare minimum to e.g. execute "bundle exec whenever --update-crontab 'foo'"

是否建议仅为食谱创建第二个项目,还是可以将厨师文件放在子目录中?

Is it advisable to create a second project just for the cookbooks or can I place chef files in a subdirectory of my rails structure without cluttering it?

推荐答案

OpsWorks目前不支持单一的Cookbook目录样式。它可以像这样构建存储库:

OpsWorks, at the moment, does not support a single cookbook directory style. It works to build the repository like this:

delayed_job
  recipes
    deploy.rb
    undeploy.rb
s3cmd
  attributes
    default.rb
  recipes
    setup.rb
    configure.rb
  templates
    default
      s3cfg.erb
whenever
  recipes
    deploy.rb
    undeploy.rb

然后在堆栈设置下,在自定义食谱下,可以添加例如每当部署部署时::。对于default.rb配方,只需添加例如

Then under stack settings, under custom cookbooks, one can add e.g. whenever::deploy under deploy. For default.rb recipes, once can just add e.g. sphinx instead of sphinx::default.

在更改并推送到存储库后,必须运行 update_custom_cookbooks 部署页面中的命令。

And after changing and pushing to the repositiory, one has to run the update_custom_cookbooks command from the deployments page.

这篇关于OpsWorks-自定义食谱中要包含的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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