Plugins

queenbee plugin

create, lint and package plugins

A plugin defines a CLI tool into a series of functions. Each function templates the command line arguments and fixes where any file or folder (called artifact) should be stored for the command to run successfully.

You can create a new plugin folder by running the command below:

queenbee plugin new <plugin-name>

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


plugin-name
├── functions
│   ├── function-1.yaml
│   ├── function-2.yaml
│   ├── ....yaml
│   └── function-n.yaml
├── config.yaml
└── package.yaml

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

queenbee plugin new test-plugin

Make some changes to the plugin, change container config etc… and finally Check everything is working as expected:

queenbee plugin lint test-plugin

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

queenbee plugin package test-plugin --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 plugin [OPTIONS] COMMAND [ARGS]...

lint

lint a plugin

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

queenbee plugin lint [OPTIONS] PATH

Arguments

PATH

Required argument

new

create a new plugin folder

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


metadata:
    name: <input-name>
    version: 0.1.0
config:
docker:
    image: docker/whalesay:latest
    workdir: /cowsay
functions:
- name: say-hi
description: Make the whale say something!
inputs:
    - name: message
    type: DAGStringInput
    default: hi
    description: What the whale will say
command: 'cowsay {{inputs.message}} | tee /tmp/hello_world.txt'
outputs:
    - name: whale-said
    type: DAGStringOutput
    path: /tmp/hello_world.txt
    - name: whale-said-file
    type: DAGFileOutput
    path: /tmp/hello_world.txt

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

queenbee plugin new [OPTIONS] NAME

Options

-p, --path <path>

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

Arguments

NAME

Required argument

package

package a plugin

This command helps your package plugins and add them to repository folders. A packaged plugin is essentially a gzipped version of its folder.

You can package a plugin in a specific folder or repository by using the --destination

flag:

queenbee plugin package path/to/my/plugin --destination path/to/my/repository/plugins

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

queenbee plugin 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

Arguments

PATH

Required argument