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

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more