Skip to main content

Opinionated wrapper around docker

Project description

An opinionated wrapper around the docker-py API that lets you use YAML to define images and run tasks.

https://travis-ci.org/delfick/harpoon.png?branch=master

See http://harpoon.readthedocs.io for the full documentation.

Installation

Just use pip:

$ pip install docker-harpoon

Configuration

Before Harpoon can be used, it must be configured. Configuration is obtained from the following locations in the following order of precedence:

  • Provided –harpoon-config value

  • HARPOON_CONFIG environment variable

  • ./harpoon.yml

Further, you can also define user-wide settings in your home directory at ~/.harpoonrc.yml. For example if you want the “dark” theme for the logging:

---

term_colors: dark

The contents of the harpoon config has only one mandatory option, images. This must be a dictionary of image_alias to image_options:

---

images:
  cacafire:
    commands:
      - FROM ubuntu:14.04
      - RUN apt-get update && apt-get -y install caca-utils
      - CMD cacafire

A rough overview of all the options available can be found at http://harpoon.readthedocs.org/en/latest/docs/configuration.html

Usage

Once harpoon is installed, there will be a new program called harpoon.

When you call harpoon without any arguments it will print out the tasks you have available.

Unless you don’t have a config file, in which case it’ll complain you have no configuration file.

Once you have a valid configuration file and have chosen a task you wish to invoke, you may use the --task cli option to invoke that task:

$ harpoon --task <task>

Most tasks will also require you to specify an image to work with:

$ harpoon --task <task> --image <image_alias>

Simpler Usage

To save typing --task and --image too much, the first positional argument is treated as task (unless it is prefixed with a dash) and the second positional argument (if also not prefixed with a dash) is taken as the image.

So:

$ harpoon --task run --image my_amazing_image

Is equivalent to:

$ harpoon run my_amazing_image

Changelog

https://harpoon.readthedocs.io/en/latest/docs/changelog.html

Tests

Run:

> ./test.sh

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docker_harpoon-0.19.0.tar.gz (53.7 kB view details)

Uploaded Source

Built Distribution

docker_harpoon-0.19.0-py3-none-any.whl (69.3 kB view details)

Uploaded Python 3

File details

Details for the file docker_harpoon-0.19.0.tar.gz.

File metadata

  • Download URL: docker_harpoon-0.19.0.tar.gz
  • Upload date:
  • Size: 53.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.8.19

File hashes

Hashes for docker_harpoon-0.19.0.tar.gz
Algorithm Hash digest
SHA256 b9e78336caa3532195de061857d33e1623ced37fbf47b699a92d559368bc7e3e
MD5 bfb1327c90bedf26b4c0f558fcbda093
BLAKE2b-256 03c5c7b83a3359d6099bda54bd8a4a2ea3c2767590ff17af985f1afbfcd21ea8

See more details on using hashes here.

File details

Details for the file docker_harpoon-0.19.0-py3-none-any.whl.

File metadata

File hashes

Hashes for docker_harpoon-0.19.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bfe15548df0fac9dd356198afdbbb255fe4c5aaeb628d957f5283edab9935476
MD5 60695b98fff94d9778aeae9caecb8203
BLAKE2b-256 d2d0eb5fdf86924f3da4c8f58b0a550622181a274e4ebffd82ab7c8188eb9ee7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page