Recipes

queenbee recipe

create, lint and package recipes

A recipe is a template used to connect multiple plugin functions and even other recipes into a re-usable flow of actions.

Recipes should be written to file using a specific folder structure as shown below:


.
├── .dependencies
│   ├── plugin
│   │   └── plugin-dep-name
│   │       ├── functions
│   │       │   ├── func-1.yaml
│   │       │   ├── ...
│   │       │   └── func-n.yaml
│   │       ├── config.yaml
│   │       └── package.yaml
│   └── recipe
│       └── recipe-dep-name
│           ├── .dependencies
│           │   ├── plugin
│           │   └── recipe
│           ├── flow
│           │   └── main.yaml
│           ├── dependencies.yaml
│           └── package.yaml
├── flow
│   └── main.yaml
├── dependencies.yaml
└── package.yaml

Here is an example “flow” to build and manage a recipe:

queenbee recipe new test-recipe

Make some changes to the recipe, add new dependencies etc… and finally compile it:

queenbee recipe install test-recipe

Check everything is working as expected:

queenbee recipe lint test-recipe

Finally you can package the recipe into the repository of your choice and index the package into your repository:

queenbee recipe package test-recipe --repository path/to/my/repository

queenbee repository index path/to/my/repository --skip

Check the docs below to see all you can do with this sub-command

queenbee recipe [OPTIONS] COMMAND [ARGS]...

install

download dependencies and save them to the .dependencies folder

This subcommand interacts mostly with the dependencies.yaml file and .dependencies folder in your recipe folder.

queenbee recipe install [OPTIONS] PATH

Arguments

PATH

Required argument

lint

lint a recipe

Use this command to check that a recipe folder is valid.

You can choose to refresh the dependencies saved in you .dependencies folder by using the --dependency-update or -u flag:

queenbee recipe lint path/to/my/recipe -u

Note that if you have not run the install command this operation will fail.

queenbee recipe lint [OPTIONS] PATH

Options

-u, --dependency-update

Fetch fresh dependencies from remote sources before running checks

Arguments

PATH

Required argument

new

create a new recipe folder

Use this command to create a new recipe. The folder will compile to the following recipe definition:


metadata:
    name: <input-name>
    tag: 0.1.0
dependencies:
- kind: plugin
name: whalesay
tag: 0.1.0
source: https://pollination.github.io/shed # Replace with name of repo
flow:
- name: main
inputs:
    - name: thing-to-say
    type: DAGStringInput
    default: hi
    description: What the whale will say
tasks:
- name: say-something
    template: whalesay/say-hi
    arguments:
    - name: message
        type: TaskArgument
        from:
          type: InputReference
          variable: thing-to-say
    returns:
    - name: whale-said
        type: TaskReturn

outputs:
    - name: what-the-whale-said
    type: DAGStringOutput
    from:
        type: TaskReference
        name: say-something
        variable: whale-said

You can indicate where you want to create the recipe folder by specifying the --path option.

queenbee recipe new [OPTIONS] NAME

Options

-p, --path <path>

The path at which to create the new recipe. Defaults to the current directory if not specified.

Arguments

NAME

Required argument

package

package a recipe

This command helps you package recipes and add them to repository folders. A packaged recipe is essentially a gzipped version of its folder.

You can package a recipe in a specific folder or repository by using the --destination flag:

queenbee recipe package path/to/my/recipe --destination path/to/my/repository/recipes

If you do not specify a --destination the command will package the recipe in the directory the command is invoked from (ie: .)

You can also decide to not pull fresh dependencies in your .dependencies folder:

queenbee recipe package path/to/my/recipe --no-update

This will ensure that when compiling dependencies into a Baked Recipe to validate your recipe, the command will not wipe your .dependencies folder and overwrite with fresh dependencies.

queenbee recipe package [OPTIONS] PATH

Options

-d, --destination <destination>

location to write the package

Default:

.

-f, --force

Boolean toggle to overwrite existing package with same name and version

--no-update

Do not fetch fresh versions of dependencies before packaging

Arguments

PATH

Required argument