dx/dxkit/commands/runtime/up.command.sh

50 lines
983 B
Bash

#!/usr/bin/env bash
# commands/runtime/up.command.sh
function cmd::runtime::up::on_load() {
flag::register \
--sync-hosts \
--skip-proxy \
--recreate \
--build \
--foreground \
--debug
}
function cmd::runtime::up::run() {
flag::parse "$@" || { cmd::runtime::up::help; return 1; }
if flag::enabled --sync-hosts; then
load_command hosts
cmd::hosts::sync
fi
if ! flag::enabled --skip-proxy; then
proxy::ensure
fi
runtime::up
}
function cmd::runtime::up::help() {
cat <<EOF
Usage: dx up [flags]
Starts the stack.
Flags:
--sync-hosts Sync domain to /etc/hosts before starting
--skip-proxy Skip proxy startup
--recreate Force-recreate containers (drops existing state)
--build Rebuild images before starting
--foreground Run in foreground (don't detach)
--debug Shell trace
Examples:
dx up
dx up --recreate
dx up --build --recreate
dx up --sync-hosts
dx up --foreground
EOF
}