0

I've got a Chef repo that uses test-kitchen. I have a pretty good battery of tests, and when I run the tests and they're successful, I have a vendor.sh script that does some cleanup and a Berks vendor. What I'd like to be able to do is automatically run that script. I suppose I could just put kitchen test {box} into that script, but then I'd have to find a way to detect success (maybe this is easy) and deal with output and things like that; I'd rather just have Kitchen do it.

I googled and searched and found nothing. Does anyone know a way?

2
  • Why is this downvoted? It's a perfectly legitimate question: How do you execute a script at the end of a Kitchen CI run? Every non-CM CI tool in the world supports this. Commented Nov 18, 2019 at 22:47
  • 1
    FTR kitchen test does exit with non 0 status if there was a failure.
    – Tensibai
    Commented Feb 11, 2022 at 15:01

1 Answer 1

3

I think what you are looking for is lifecycle hooks.

https://kitchen.ci/docs/reference/lifecycle-hooks/

For example, you could have this in you kitchen.yml file.


suites:
- name: default
  lifecycle:
    post_verify:
    - local: <script>
1
  • Sorry so late in accepting answer, I suppose I lost track of this. :) Commented Feb 17, 2022 at 23:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.