DEV Community

Cover image for Chef Cookbook GitHub Actions with Chef BDD and Code Analysis
Saravanan Gnanaguru
Saravanan Gnanaguru

Posted on • Edited on

4 3

Chef Cookbook GitHub Actions with Chef BDD and Code Analysis

My Workflow

Chef is widely used and most popular Infra as code technology in DevOps World.

This specific GitHub Action Workflow has been used for creating DIY deployment for Chef cookbooks.

The below mentioned Continuous Integration aspects are covered in the Workflow,

  • It checks-out the code into Workspace
  • Performs Cookbook Code Analysis using cookstyle
  • Executes the cookbook in local mode (chef-client - z option)
  • Executes the rspec unit test cases (Chef cookbook Behaviour Driven Development)
  • Packages the cookbooks using Berkshelf which uses berksfile
  • Creates tar.gz archive of Cookbook packages
  • In case of any workflow failures, it sends out email to respective developers and maintainers of the repository

Submission Category:

DIY Deployments

Yaml File or Link to Code:

Chef Cookbook GitHub Actions Workflow

GitHub logo chefgs / dev_github_actions

Chef cookbook Github Action Demo Repository, created for Dev community hackathon submission.

Chef Cookbook DIY Github Action

Workflow Details

Chef is widely used and most popular Infra as code technology in DevOps World..

This specific GitHub Action Workflow has been used for creating DIY deployment for Chef cookbooks The below mentioned Continuous Integration aspects are covered in the Workflow,

  • It checks-out the code into Workspace
  • Performs Cookbook Code Analysis using cookstyle
  • Executes the cookbook in local mode (chef-client - z option)
  • Executes the rspec unit test cases (Chef cookbook Behaviour Driven Development)
  • Packages the cookbooks using Berkshelf which uses berksfile
  • Creates tar.gz archive of Cookbook packages
  • In case of any workflow failures, it sends out email to respective developers and maintainers of the repository

Here is the link to Github Action Workflow file

Cookbook Details

Cookbook performs below tasks,

  • Creates an user group called chefusers
  • Creates an user called 'bob'
  • Creates a directory cheftest in '/tmp'
  • Creates a…

Additional Resources / Info:

Developer: chefgs

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay