Skip to content

Commit

Permalink
refactor: major overhaul to plugin architecture
Browse files Browse the repository at this point in the history
Plugins are now registered and loaded separately, and are now defined
as modules with an exported `gardenPlugin` function.

BREAKING CHANGE:
This includes some changes to the project schema and how it is resolved,
as well as how the main `Garden` class is instantiated. The `Garden`
class is now called with an environment name, which is then fixed for
the session. The env configuration is resolved by merging the specific
environment configuration with a global configuration specified on the
new `global` key in the project config. The schema for the `providers`
key also different - its keys should now match plugin names, and
contain configuration for those plugins.
  • Loading branch information
edvald committed Apr 18, 2018
1 parent c60c24b commit 3b97e08
Show file tree
Hide file tree
Showing 47 changed files with 2,087 additions and 1,786 deletions.
4 changes: 4 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"check-coverage": true,
"per-file": true,
"lines": 0,
"statements": 0,
"functions": 0,
"branches": 0,
"reporter": [
"html",
"text"
Expand Down
20 changes: 10 additions & 10 deletions examples/hello-world/garden.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
project:
name: hello-world
global:
providers:
container: {}
npm-package: {}
variables:
my-variable: hello-variable
environments:
local:
providers:
docker:
type: kubernetes
kubernetes:
context: docker-for-desktop
gcf:
type: local-google-cloud-functions
local-google-cloud-functions: {}
dev:
providers:
docker:
type: google-app-engine
gcf:
type: google-cloud-functions
google-app-engine: {}
google-cloud-functions:
default-project: garden-hello-world
variables:
my-variable: hello-variable
3 changes: 1 addition & 2 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import { BuildCommand } from "./commands/build"
import { EnvironmentCommand } from "./commands/environment/index"
import { DeployCommand } from "./commands/deploy"
import { CallCommand } from "./commands/call"
import { defaultPlugins } from "./plugins"
import { TestCommand } from "./commands/test"
import { DevCommand } from "./commands/dev"
import { LogsCommand } from "./commands/logs"
Expand Down Expand Up @@ -282,7 +281,7 @@ export class GardenCli {
)
}

const garden = await Garden.factory(root, { env, logger, plugins: defaultPlugins })
const garden = await Garden.factory(root, { env, logger })
return command.action(garden.pluginContext, argsForAction, optsForAction)
}

Expand Down
Loading

0 comments on commit 3b97e08

Please sign in to comment.