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

42 lines
723 B
Bash

#!/usr/bin/env bash
# commands/docker/up.command.sh
function cmd::docker::up::on_load() {
flag::register \
--sync-hosts \
--skip-proxy \
--debug
}
function cmd::docker::up::run() {
flag::parse "$@" || { cmd::docker::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
docker::compose::up
}
function cmd::docker::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
--debug Shell trace
Examples:
dx up
dx up --sync-hosts
dx up --skip-proxy
EOF
}