Task Plugins
"Wrapped Container" Tasks
If you'd like to run a Docker container as a Harpoon task:
Add the following
LABEL
s to theDockerfile
for your image:LABEL harpoon_name=mytask LABEL harpoon_type=task LABEL harpoon_args="<arg...>" LABEL harpoon_description="My task does this and that"
Build, tag, and push your plugin to any Docker registry.
docker build -t mytask . docker tag mytask <repository>/mytask docker push <repository>/mytask
Install your plugin.
harpoon plug:in <repository>/mytask
This task's commands can now be run with harpoon mytask <arg...>
. Try
harpoon mytask:help
😁
Helper Tasks
You can provide your own custom tasks and use them with Harpoon. For a
simple example, check out the http
task's
handler.sh
and
bootstrap.sh
. Note the use of the
## [<arg>...] %% Your description
comment convention. Harpoon will
use this to automatically add your custom tasks to the help
output.
- Create directory for your task project, or add to an existing project.
- Inside your project directory, create a directory named
harpoon-plugin
. In the
harpoon-plugin
directory:Create a file named
handler.sh
. Harpoon will use this to handle all commands/sub-commands for your task.(Optional) Create a file named
bootstrap.sh
. Harpoon will use this to load any custom environment variables you'd like to set and share with other tasks.Create a
Dockerfile
(or add to one that already exists) with metadata for Harpoon to use during installation.FROM scratch COPY harpoon-plugin /harpoon-plugin LABEL harpoon_name=mytask LABEL harpoon_type=task LABEL harpoon_dir=/harpoon-plugin
Build, tag, and push your plugin to any Docker registry.
docker build -t mytask . docker tag mytask <repository>/mytask docker push <repository>/mytask
Install your plugin.
harpoon plug:in <repository>/mytask
This task's commands can now be run with harpoon mytask:*
. Try
harpoon mytask:help
😁