Skip to content

Commit

Permalink
feat: add websocket endpoint to API server
Browse files Browse the repository at this point in the history
The endpoint forwards any event emitted to `garden.events` to open
connections, and allows commands to be executed via the socket as well.
  • Loading branch information
edvald committed Dec 3, 2018
1 parent 3c19e36 commit e6fcc8b
Show file tree
Hide file tree
Showing 20 changed files with 779 additions and 169 deletions.
4 changes: 2 additions & 2 deletions docs/reference/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ Examples:

##### Usage

garden build [module] [options]
garden build [modules] [options]

##### Arguments

| Argument | Required | Description |
| -------- | -------- | ----------- |
| `module` | No | Specify module(s) to build. Use comma as a separator to specify multiple modules.
| `modules` | No | Specify module(s) to build. Use comma as a separator to specify multiple modules.

##### Options

Expand Down
159 changes: 150 additions & 9 deletions garden-service/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion garden-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
],
"dependencies": {
"@drubin/client-node": "0.7.1-rc1",
"@types/koa-bodyparser": "^4.2.1",
"ansi-escapes": "^3.1.0",
"async-exit-hook": "^2.0.1",
"async-lock": "^1.1.3",
Expand Down Expand Up @@ -59,6 +58,7 @@
"koa": "^2.6.2",
"koa-bodyparser": "^4.2.1",
"koa-router": "^7.4.0",
"koa-websocket": "^5.0.1",
"lodash": "^4.17.11",
"log-symbols": "^2.2.0",
"moment": "^2.22.2",
Expand All @@ -69,6 +69,7 @@
"split": "^1.0.1",
"string-width": "^2.1.1",
"strip-ansi": "^5.0.0",
"supertest": "^3.3.0",
"sywac": "^1.2.1",
"tar": "^4.4.6",
"terminal-link": "^1.1.0",
Expand Down Expand Up @@ -102,7 +103,9 @@
"@types/json-stringify-safe": "^5.0.0",
"@types/klaw": "^2.1.1",
"@types/koa": "^2.0.47",
"@types/koa-bodyparser": "^4.2.1",
"@types/koa-router": "^7.0.35",
"@types/koa-websocket": "^5.0.3",
"@types/lodash": "^4.14.117",
"@types/log-symbols": "^2.0.0",
"@types/log-update": "^2.0.0",
Expand All @@ -115,6 +118,7 @@
"@types/path-is-inside": "^1.0.0",
"@types/prettyjson": "0.0.28",
"@types/string-width": "^2.0.0",
"@types/supertest": "^2.0.6",
"@types/tar": "^4.0.0",
"@types/uniqid": "^4.1.2",
"@types/unzip": "^0.1.1",
Expand Down
6 changes: 2 additions & 4 deletions garden-service/src/cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { intersection, merge, range } from "lodash"
import { resolve } from "path"
import { safeDump } from "js-yaml"
import { coreCommands } from "../commands/commands"

import { DeepPrimitiveMap } from "../config/common"
import { getEnumKeys, shutdown, sleep } from "../util/util"
import {
Expand All @@ -24,8 +23,7 @@ import {
StringParameter,
} from "../commands/base"
import { GardenError, InternalError, PluginError, toGardenError } from "../exceptions"
import { ContextOpts, Garden } from "../garden"

import { Garden, GardenOpts } from "../garden"
import { getLogger, Logger, LoggerType } from "../logger/logger"
import { LogLevel } from "../logger/log-node"
import { BasicTerminalWriter } from "../logger/writers/basic-terminal-writer"
Expand Down Expand Up @@ -268,7 +266,7 @@ export class GardenCli {
// entries (i.e. print new lines).
const log = logger.placeholder()

const contextOpts: ContextOpts = { env, log }
const contextOpts: GardenOpts = { environmentName: env, log }
if (command.noProject) {
contextOpts.config = MOCK_CONFIG
}
Expand Down
Loading

0 comments on commit e6fcc8b

Please sign in to comment.