How are people testing opsworks cookbooks?

前端 未结 6 894
旧时难觅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:20

    I was able to solve this is issue using Chef+Kitchen+Vagrant

    Here's my wrapper: https://github.com/elitechance/opsworks-cookbooks-wrapper

    Below is how to test

    git clone https://github.com/elitechance/opsworks-cookbooks-wrapper.git

    git clone https://github.com/aws/opsworks-cookbooks.git

    cd opsworks-cookbooks-wrapper

    cp .kitchen.sample.yml .kitchen.yml

    cp Berksfile.sample Berksfile

    cp metadata.sample.rb metadata.rb

    The last command will simulate OpsWorks NodeJs Setup Recipes, see .kitchen.sample.yml for details.

    $ chef exec kitchen setup

    KNOWN BUGS

    The first time you run $ chef exec kitchen setup, you will encounter errors saying:

    Running handlers: [2016-04-08T17:08:34+00:00] ERROR: Running exception handlers Running handlers complete [2016-04-08T17:08:34+00:00] ERROR: Exception handlers complete Chef Client failed. 43 resources updated in 01 minutes 02 seconds [2016-04-08T17:08:34+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out [2016-04-08T17:08:34+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report [2016-04-08T17:08:34+00:00] ERROR: ruby_blockFallback for remote_file[/tmp/rubygems-2.2.2.tgz] had an error: NoMethodError: remote_file/tmp/rubygems-2.2.2.tgz had an error: NoMethodError: undefined method `to_sym' for [:create]:Array [2016-04-08T17:08:34+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

    Just run again:

    $ chef exec kitchen setup

提交回复
热议问题