Documentation ¶
Overview ¶
Package recipespy implements utilities for the python recipes framework.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bundle ¶
Bundle creates a hermetically runnable recipe bundle.
This is done by packaging the repo and all dependency repos into a folder and then generating an entrypoint script with `-O` override flags to this folder. Optionally provides dep repos with local override paths to pick up the repo from local override instead of repos checked out to .recipe_deps directory during the recipe bootstrap process.
The general principle is that the input to bundle is:
- a fully bootstrapped recipe repo. All dependency repos specified in recipes.cfg are checked out to .recipe_deps directory under the recipe root dir.
- files tagged with the `recipes` gitattribute value (see `git help gitattributes`).
and the output is a runnable folder at `dest` for the named repo.
Included files ¶
By default, bundle will include all recipes/ and recipe_modules/ files in your repo, plus the `recipes.cfg` file, and excluding all json expectation files. Recipe bundle also uses the standard `gitattributes` mechanism for tagging files within the repo, and will also include these files when generating the bundle. In particular, it looks for files tagged with the string `recipes`. As an example, you could put this in a `.gitattributes` file in your repo:
*.py recipes *_test.py -recipes
That would include all .py files, but exclude all _test.py files. See the page `git help gitattributes` for more information on how gitattributes work.
The recipe repo to bundle may or may not be a git repo. There is a slight difference when bundling a recipe repo that is a git repo that the bundling process leverages the git index, so any untracked file will NOT be in the final bundle.
Types ¶
type Repo ¶
type Repo struct { // Path to the repo root on disk. Absolute Path. Path string // Spec is the config in infra/config/recipes.cfg file Spec *recipepb.RepoSpec }
Repo represents a recipe repo.
It is a folder on disk which contains all of the requirements of a recipe repo:
- an infra/config/recipes.cfg file
- a `recipes` and/or `recipe_modules` folder
- a recipes.py script
func RepoFromPath ¶
RepoFromPath creates a recipe Repo instance from a local path.
func (*Repo) CfgPathRel ¶
CfgPathRel returns the relative path from the repo root to recipes.cfg.
func (*Repo) RecipeDepsPath ¶
RecipeDepsPath returns the absolute path to the `.recipe_deps` directory.
func (*Repo) RecipesRootPath ¶
RecipesRootPath returns the path to the base where all recipes are found in the repo.
This is where the "recipes" and "recipe_modules" directories live.
func (*Repo) RecipesRootPathRel ¶
RecipesRootPathRel is like RecipesRootPath but returns relative path to the root. Returns empty path if root path is the repo root.
Directories ¶
Path | Synopsis |
---|---|
Package recipespb contains the protobuf definition for recipe.
|
Package recipespb contains the protobuf definition for recipe. |