Documentation
¶
Overview ¶
Package cookbook finds local cookbooks and packs them into tarballs.
What a cookbook is (which files belong to it, what its metadata says) is decided by cinc-api, the same way for every command: see Load.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractArchive ¶
ExtractArchive unpacks a gzipped cookbook tarball read from r into destDir, which should be empty, and returns the path of the single top-level directory the archive creates (Supermarket tarballs are rooted at <cookbook>/...). Extraction is guarded as tarball.Extract describes.
func Load ¶ added in v0.26.0
func Load(dir string, skipChefignore bool) (*cinc.LocalCookbook, error)
Load reads the cookbook in dir the way an upload sees it: the files Chef's loader would pick (chefignore applied unless skipChefignore) and its metadata, with the name falling back to the directory's. A metadata.rb that computes its version is refused with a message saying how to fix it, since cinc can't run the Ruby and would otherwise publish the cookbook as 0.0.0.
Types ¶
type Archive ¶
type Archive struct {
Name string
Bytes []byte
// Files lists every entry, rooted at the cookbook name
// (nginx/recipes/default.rb), in the order they were written.
Files []string
}
Archive is an in-memory gzip-compressed tarball and its manifest.
func BuildArchive ¶
BuildArchive packs cb's files into a deterministic gzipped tarball rooted at cb.Name/. overlay adds files, or replaces cb's own, by cookbook-relative path (metadata.json, say), without touching the cookbook on disk.