How are people testing opsworks cookbooks?

前端 未结 6 902
旧时难觅i
旧时难觅i 2021-01-31 18:33

I have a fairly complex deployment of dynamically configured instances of a rail apps on nginx using passenger that I currently use Capistrano for. I am trying to automate the e

6条回答
  •  攒了一身酷
    2021-01-31 19:17

    We are using Opsworks with a lot of custom cookbooks, and vagrant as well. While the test-coverage is far from perfect, it works pretty smooth, adapting community cookbooks as well. Our cookbook repository is public: https://github.com/till/easybib-cookbooks

    The interesting bits of this repo are:

    • We use a role-recipe as the entry point for each layer instead of specifiying multiple recipes with the layer in opsworks: https://github.com/till/easybib-cookbooks/blob/master/easybib/recipes/role-nginxapp-api.rb
    • We check if the recipe run is in AWS or in Vagrant using a custom library function: https://github.com/till/easybib-cookbooks/blob/master/easybib/libraries/easybib.rb#L208-L216
    • All opsworks-specific cookbooks/providers are usually only used in the deploy-cookbook, which we only include when is_aws is true, otherwise we fall back for a default application deployment.

    Browsing our cookbooks should give you some more hints for your questions. We test our cookbooks with Travis, and do not test the opsworks cookbooks at all. Although I have to note that I am currently playing around there with some ideas how to integrate them in our test runs, since without their providers, testing our deploy cookbook is pretty much impossible.

提交回复
热议问题