0.0.4 • Published 2 months ago

haz-cli v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

HAZ

HAZ is a CLI tool that helps you manage your docker containers. It is designed to be used in conjunction with docker-compose.

codecov Version Downloads/week

Table of Contents

Usage

$ npm install -g haz-cli
$ haz COMMAND
running command...
$ haz (--version)
haz-cli/0.0.4 darwin-arm64 node-v21.7.1
$ haz --help [COMMAND]
USAGE
  $ haz COMMAND
...

Configuration

To configure haz, create a .haz file in the root of your project. It will be formatted as a yaml file, and will contain the configuration for your docker services and other settings.

# Docker Configuration
docker:
  # Service Configuration
  # The name of the service in your docker-compose file
  web:
    # Setup Commands
    ###
    # These should only be run if you need something to be installed after the container is built.
    # If it is something that can be done during the build process, it should be done in the Dockerfile.
    ###
    setup:
      - npm i -g yarn
      - yarn install
    # Unit Test Command
    unit: YourUnitTestCommand
    # Coverage Test Command
    coverage: YourCoverageTestCommand
  db:
    unit: YourUnitTestCommand
    coverage: YourCoverageTestCommand

Commands

haz docker:down

Bring docker containers down

USAGE
  $ haz docker:down [-v]

FLAGS
  -v, --verbose  Run with verbose logging

DESCRIPTION
  Bring docker containers down

  Bring docker containers down

See code: src/commands/docker/down.ts

haz docker:pull [SERVICE]

Pull Docker Images

USAGE
  $ haz docker:pull [SERVICE] [-v] [--dry-run] [--ignore-buildable] [--ignore-pull-failures] [--include-deops]
    [--policy missing|always]

ARGUMENTS
  SERVICE  The service you want to pull the image for.

FLAGS
  -v, --verbose               Run with verbose logging
      --dry-run               Show what would be done, but do not actually do anything
      --ignore-buildable      Ignore imgages than can be built
      --ignore-pull-failures  Pull what it can and ignore failures
      --include-deops         Include dependencies
      --policy=<option>       Apply pull policy
                              <options: missing|always>

See code: src/commands/docker/pull.ts

haz docker:setup

Setup the docker environment

USAGE
  $ haz docker:setup [-v] [-s]

FLAGS
  -s, --start    Start the stack after setup.
  -v, --verbose  Run with verbose logging

DESCRIPTION
  Setup the docker environment


  This command will pull the docker images down, and cycle through the .haz file
  to setup the environment.

See code: src/commands/docker/setup.ts

haz docker:stop

Stop the docker containers

USAGE
  $ haz docker:stop [-v]

FLAGS
  -v, --verbose  Run with verbose logging

DESCRIPTION
  Stop the docker containers

  Stop the docker containers

See code: src/commands/docker/stop.ts

haz docker:up

Bring docker containers up

USAGE
  $ haz docker:up [-v]

FLAGS
  -v, --verbose  Run with verbose logging

See code: src/commands/docker/up.ts

haz test:coverage SERVICE

Run coverage tests on a container.

USAGE
  $ haz test:coverage SERVICE [-v]

ARGUMENTS
  SERVICE  The service you want to run tests on.

FLAGS
  -v, --verbose  Run with verbose logging

DESCRIPTION
  Run coverage tests on a container.

  Run coverage tests on a container.

See code: src/commands/test/coverage.ts

haz test:unit SERVICE

Run unit tests on a container.

USAGE
  $ haz test:unit SERVICE [-v]

ARGUMENTS
  SERVICE  The service you want to run tests on.

FLAGS
  -v, --verbose  Run with verbose logging

See code: src/commands/test/unit.ts