hammerkit

Up

Start the services of your build file and keep them running.

Services normally start and stop automatically based on the needs of the tasks you run. The up command starts them directly, which is useful to keep shared services such as a database running across several task runs during development.

hammerkit up

This starts every service in the build file (or the named ones, or the ones matching the --filter/--exclude labels) and waits until you stop it. Use --daemon to start the services in the background and return immediately.

hammerkit up --daemon

With --daemon, up returns once every service passed its healthcheck (--wait ready, the default). --wait start returns as soon as the containers are started instead; services that other services need are still awaited, since those can only start once their needs are ready.

A service that is already running is reused, unless its definition changed since it was started (image, command, env values, ports, mounts, volumes, healthcheck, its init task, or a service it needs): then up and run recreate it. A reused service does not run its init again.

Stop services started this way with hammerkit down.

Start by name

Name the services to start only those, with the services they need:

hammerkit up postgres redis
hammerkit up --daemon infra:postgres

A service of an include or a reference goes by its full name, as hammerkit ls lists it. A task name starts the task, its dependencies and the services it needs: hammerkit up dev:serve keeps a dev server and its database running. A name that is no task or service is an error, and names can't be combined with --filter/--exclude.

Pass arguments

Arguments after -- are appended to the cmd of the one service (or task) up starts:

hammerkit up api -- --inspect
hammerkit up --filter app=api -- --inspect

Names or a filter that select several services or tasks take no arguments. See arguments.

Pass --env <name> to start the services in a configured environment, for example a Kubernetes cluster declared under environments:. See running on Kubernetes.

Options

Usage: hammerkit up [options] [names...] [-- args...]

Arguments:
  names                       tasks and services to start, all when none is named

Options:
  -f, --filter <labels...>    filter task and services with labels
  -e, --exclude <labels...>   exclude task and services with labels
  -c, --concurrency <number>  parallel worker count (default: 4, unbounded when every task and
                              service requests cpus and memory)
  --skip-resource-check       start even when a task with its services requests more than
                              the host has
  -w, --watch                 watch tasks (default: false)
  --wait <mode>                with --daemon, return once services are ready or
                               once they started (choices: "ready", "start",
                               default: "ready")
  -d, --daemon                run services in background (default: false)
  --env <name>                environment
  -l, --log <mode>            log mode (choices: "interactive", "live", "grouped")
  --cache <method>            caching method to compare (choices: "checksum", "modify-date", "none")
  --cache-read-only           restore from cache backends but never push to them (or set HAMMERKIT_CACHE_READ_ONLY=1)
  --timeout <duration>        fail tasks without their own timeout after this long (e.g. 10m)
  --max-timeout <duration>    fail any task after this long, also one with a longer timeout
                              of its own (e.g. 2m)
  --network <level>           the most any task or service reaches besides its needs: none,
                              open or allow:<host>,<host>
  -h, --help                  display help for command

On this page