This commit is contained in:
Mikan
2026-10-16 12:36:58 +04:00
parent 486a718eab
commit fbff0edf77
6 changed files with 112 additions and 180 deletions

View File

@@ -17,9 +17,38 @@ require_ssh_role() {
fi
}
require_node_instance() {
if [ -z "${NODE_INSTANCE:-}" ]; then
echo "ERROR: NODE_INSTANCE is not set." >&2
exit 1
fi
}
require_project_dir() {
if [ ! -d "$PROJECT_DIR" ]; then
echo "ERROR: Project directory not found: $PROJECT_DIR" >&2
exit 1
fi
}
}
get_service_container() {
ROLE="$1"
case "$ROLE" in
ssh|ssh-main) ROLE="ssh-main" ;;
comfy) ROLE="comfyui" ;;
esac
CONTAINER=$(docker ps -a \
--filter "label=node.role=$ROLE" \
--filter "label=node.instance=${NODE_INSTANCE}" \
--format '{{.Names}}' \
| head -n 1)
if [ -z "$CONTAINER" ]; then
return 1
fi
echo "$CONTAINER"
}