Torben -
Thanks for sharing. Its a nifty solution. In my case, I have things
I want to do outside the VMs to prepare for each converge. I want to
package up some files to be placed into the the data_path. I am not sure
how to handle that in vagrantfile.
----- Original message -----
From: Torben Knerr mail@tknerr.de
To: yoshi@spendiff.net
Cc: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Re: Re: Re: Re: Re: Re: Tips for running a script before
kitchen converge?
Date: Wed, Sep 30, 2015 1:11 PM
I had a similar issue and came to this solution:
In my case I have the whole ~/ directory under control, and I wanted it
to apply globally rather than repreating in every project kitchen /
Vagrantfile. Should work for local ones too
Just for inspiration...
HTH, Torben
On Wed, Sep 30, 2015 at 5:14 PM, Yoshi Spendiff yoshi@spendiff.net
wrote:
Looks like it's in the works:
Add lifecycle hooks to various phases (including provisioners) · Issue #329 · test-kitchen/test-kitchen · GitHub
You might have to use regular Vagrant for now as that supports multiple
provisioners (i.e. run the shell provisioner before Chef)
On 29 September 2015 at 20:18, Brian O'Connell boc@us.ibm.com wrote:
I am struggling with a similar scenario. As part of our chefdk
bootstrap, we package up a set of cookbooks using berks package. We have
a a curl bash that end users execute to install/update the dev environment.
We have been testing using test kitchen w/ the chef provisioner but
because the testing doesn't fully simulate our real environment (chef may
or may not be installed, bash script to start the process not run) we have
had a couple of defects escape testing.
The pre_create_command doesn't work because we want these set of
commands to be run before every converge, not just the first create.
I have considered using the vagrantfiles directive with a custom vagrant
file, but its not clear to me that would help since that only seems to get
executed on create as well.
I could create a script that does this, but that i somewhat unsatisfying
because it fights against the muscle memory for all of our other cookbooks.
Has anyone come across a good solution to resolve this in test kitchen?
It feels like a pre_converge_command would be optimal for this sort of
scenario.
Thanks,
Brian
----- Original message -----
From: Robert Freiberger rfreiberger@gmail.com
To: "chef@lists.opscode.com" chef@lists.opscode.com
Cc:
Subject: [chef] Re: Re: Re: Tips for running a script before kitchen
converge?
Date: Tue, Sep 29, 2015 5:46 PM
Hello,
Thanks Brandon and Steve for your recommendations. Apologies as I was
away but I'm testing these features now. My original goal was to edit a
Vagrant box and make some changes (just add a Ruby script to execute during
start up) but after reading, might be easier to keep this separate.
Thanks again,
Robert
On Fri, Sep 18, 2015 at 6:42 PM Steve Murawski <
steven.murawski@gmail.com> wrote:
You can tell vagrant to use it's shell provisioner, but you'd likely
need to provide a custom vagrantfile.erb (there's a parameter for that in
the kitchen-vagrant driver).
The pre_create_command happens before the vagrant up, so that'd be
something more for prepping your host environment (maybe staging sync'd
folders or something).
Steve
On Fri, Sep 18, 2015 at 4:44 AM, Brandon Raabe brandocorp@gmail.com
wrote:
Hey Robert,
I'm not sure what's in the script, but the pre_create_command
option
may be what you're looking for. I'm assuming you're using kitchen-vagrant.
GitHub - test-kitchen/kitchen-vagrant: A Test Kitchen Driver for Vagrant
On Thu, Sep 17, 2015 at 2:53 PM, Robert Freiberger <
rfreiberger@gmail.com> wrote:
Hello,
I'm working on a simple Vagrant box with Test Kitchen and pretty sure
this is a simple request. Is it possible to execute a script before kitchen
converge? Maybe I'm not seeing this, but I checked the options from Test
Kitchen.
I really would like to stay away from customizing the box file if
possible.
Thanks,
Robert
--
Steven Murawski
Community Software Development Engineer @ Chef
Microsoft MVP - PowerShell
http://stevenmurawski.com