Task Plugins

"Wrapped Container" Tasks

If you'd like to run a Docker container as a Harpoon task:

  1. Add the following LABELs to the Dockerfile for your image:

    LABEL harpoon_name=mytask
    LABEL harpoon_type=task
    LABEL harpoon_args="<arg...>"
    LABEL harpoon_description="My task does this and that"
    
  2. Build, tag, and push your plugin to any Docker registry.

    docker build -t mytask .
    docker tag mytask <repository>/mytask
    docker push <repository>/mytask
    
  3. 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.

  1. Create directory for your task project, or add to an existing project.
  2. Inside your project directory, create a directory named harpoon-plugin.
  3. In the harpoon-plugin directory:

    1. Create a file named handler.sh. Harpoon will use this to handle all commands/sub-commands for your task.

    2. (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.

    3. 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
      
    4. Build, tag, and push your plugin to any Docker registry.

      docker build -t mytask .
      docker tag mytask <repository>/mytask
      docker push <repository>/mytask
      
  4. Install your plugin.

    harpoon plug:in <repository>/mytask
    

This task's commands can now be run with harpoon mytask:*. Try harpoon mytask:help 😁

results matching ""

    No results matching ""