{"id":20444101,"url":"https://github.com/tknerr/sample-toplevel-cookbook","last_synced_at":"2025-04-12T23:53:45.914Z","repository":{"id":9544746,"uuid":"11450181","full_name":"tknerr/sample-toplevel-cookbook","owner":"tknerr","description":"A sample \"top-level\" cookbook hosting a website","archived":false,"fork":false,"pushed_at":"2016-05-10T20:56:48.000Z","size":128,"stargazers_count":10,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T23:53:41.687Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tknerr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-16T13:28:06.000Z","updated_at":"2020-06-10T10:02:46.000Z","dependencies_parsed_at":"2022-09-10T09:23:30.972Z","dependency_job_id":null,"html_url":"https://github.com/tknerr/sample-toplevel-cookbook","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tknerr%2Fsample-toplevel-cookbook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tknerr%2Fsample-toplevel-cookbook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tknerr%2Fsample-toplevel-cookbook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tknerr%2Fsample-toplevel-cookbook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tknerr","download_url":"https://codeload.github.com/tknerr/sample-toplevel-cookbook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647237,"owners_count":21139083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T09:51:14.448Z","updated_at":"2025-04-12T23:53:45.894Z","avatar_url":"https://github.com/tknerr.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# README\n\n[![Circle CI](https://circleci.com/gh/tknerr/sample-toplevel-cookbook/tree/master.svg?style=shield)](https://circleci.com/gh/tknerr/sample-toplevel-cookbook/tree/master)\n\nThis is a minimal \"toplevel cookbook\" example. A \"toplevel cookbook\" is the single [top-level cookbook](http://lists.opscode.com/sympa/arc/chef/2014-01/msg00419.html) which represents a node. It may depend on other \"library\" or \"application\" cookbooks.\n\nNote: this cookbook was previously (until v0.1.2) named `sample-application-cookbook`, but since the term \"application cookbook\" is so much overloaded in the Chef community [I now call them \"top-level cookbooks\"](https://github.com/berkshelf/berkshelf/issues/535#issuecomment-40890497).\n\n# Top-Level Application\n\nIn this case it's really nothing more than a templatable sample.html file served via apache.\n\nIt outputs the value of the `node['sample_app']['words_of_wisdom']` attribute to the `sample.html` file and optionally the items of the data bag named `yummy` (if any).\n\n# Tooling\n\nIt's meant as an example [Chef](https://www.chef.io/chef/) cookbook and is also used for testing [Bill's Kitchen](https://github.com/tknerr/bills-kitchen) which bundles ChefDK, Vagrant and Docker for the Windows platform.\n\nAll development dependencies are declared in the [`Gemfile`](https://github.com/tknerr/sample-toplevel-cookbook/blob/master/Gemfile), which are mostly gems for cookbook testing, and we are testing on the following levels:\n\n * ruby codestyle \u0026 liniting via [rubocop](https://github.com/bbatsov/rubocop)\n * chef linting via [foodcritic](http://acrmp.github.io/foodcritic/)\n * unit tests via [chefspec](https://github.com/acrmp/chefspec) (using [implicit receivers](http://stackoverflow.com/questions/12260534/using-implicit-subject-with-expect-in-rspec-2-11) for crisper syntax)\n * integration tests via [test-kitchen](https://github.com/opscode/test-kitchen) / [serverspec](http://serverspec.org/)\n\n\n# Usage\n\n## Running Unit and Integration Tests\n\n* run `bundle install` to install the required gems from `Gemfile`\n* run `rake -T` to see the available rake tasks for testing this cookbook\n* run `rake test` to run all unit-level tests, including syntax, foodcritic, codestyle and chefspec\n* run `rake integration` to run integration tests via test-kitchen / serverspec\n\n## Interacting with the Application using Test-Kitchen\n\n* run `bundle exec kitchen converge` to bring up the sample-app in a local VM\n* visit http://localhost:8080/sample.html to check whether our sample app is deployed\n* change the `:words_of_wisdom` attribute in .kitchen.yml, provision via `bundle exec kitchen converge` and check the sample app again\n* run `bundle exec kitchen destroy` to terminate and delete the VM\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftknerr%2Fsample-toplevel-cookbook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftknerr%2Fsample-toplevel-cookbook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftknerr%2Fsample-toplevel-cookbook/lists"}