diff --git a/core/src/config/template-contexts/actions.ts b/core/src/config/template-contexts/actions.ts index cbfe3ca3bf..551852af57 100644 --- a/core/src/config/template-contexts/actions.ts +++ b/core/src/config/template-contexts/actions.ts @@ -203,13 +203,12 @@ export interface ActionSpecContextParams { * Used to resolve action spec and variables. */ export class ActionSpecContext extends OutputConfigContext { - // TODO-0.13.0: rename to actions (to allow using action singular in certain contexts + match the modules field) @schema( ActionReferencesContext.getSchema().description( "Runtime outputs and information from other actions (only resolved at runtime when executing actions)." ) ) - public action: ActionReferencesContext + public actions: ActionReferencesContext @schema(ActionReferencesContext.getSchema().description("Alias for `action`.")) public runtime: ActionReferencesContext @@ -239,8 +238,15 @@ export class ActionSpecContext extends OutputConfigContext { public this: ActionReferenceContext constructor(params: ActionSpecContextParams) { - const { action, garden, partialRuntimeResolution, variables, inputs, resolvedDependencies, executedDependencies } = - params + const { + action, + garden, + partialRuntimeResolution, + variables, + inputs, + resolvedDependencies, + executedDependencies, + } = params const internal = action.getInternal() @@ -260,13 +266,13 @@ export class ActionSpecContext extends OutputConfigContext { const parentName = internal?.parentName const templateName = internal?.templateName - this.action = new ActionReferencesContext(this, partialRuntimeResolution, [ + this.actions = new ActionReferencesContext(this, partialRuntimeResolution, [ ...resolvedDependencies, ...executedDependencies, ]) // Throw specific error when attempting to resolve self - this.action[action.kind.toLowerCase()].set( + this.actions[action.kind.toLowerCase()].set( name, new ErrorContext(`Action ${chalk.white.bold(action.key())} cannot reference itself.`) ) @@ -277,7 +283,7 @@ export class ActionSpecContext extends OutputConfigContext { } this.inputs = inputs - this.runtime = this.action + this.runtime = this.actions this.this = new ActionReferenceContext({ root: this, diff --git a/core/src/outputs.ts b/core/src/outputs.ts index 80d27d646a..c098977180 100644 --- a/core/src/outputs.ts +++ b/core/src/outputs.ts @@ -51,7 +51,7 @@ export async function resolveProjectOutputs(garden: Garden, log: Log): Promiseref[1], name: ref[2] as string }) } } diff --git a/core/src/plugins/kubernetes/sync.ts b/core/src/plugins/kubernetes/sync.ts index 2def0200b8..8203614030 100644 --- a/core/src/plugins/kubernetes/sync.ts +++ b/core/src/plugins/kubernetes/sync.ts @@ -128,7 +128,7 @@ export interface KubernetesDeployDevModeSyncSpec extends DevModeSyncOptions { containerName?: string } -const exampleActionRef = templateStringLiteral("action.build.my-container-image.sourcePath") +const exampleActionRef = templateStringLiteral("actions.build.my-container-image.sourcePath") export const kubernetesDeploySyncPathSchema = () => syncDefaultsSchema() diff --git a/core/src/template-string/template-string.ts b/core/src/template-string/template-string.ts index bf0ade9863..743ce5d89f 100644 --- a/core/src/template-string/template-string.ts +++ b/core/src/template-string/template-string.ts @@ -494,7 +494,7 @@ export function getActionTemplateReferences(config: T): Action // ${action.*} const refs: ActionTemplateReference[] = rawRefs - .filter((ref) => ref[0] === "action") + .filter((ref) => ref[0] === "actions") .map((ref) => { if (!ref[1]) { throw new ConfigurationError("Found invalid action reference (missing kind)", { config, ref }) diff --git a/core/test/data/test-projects/helm/api/garden.yml b/core/test/data/test-projects/helm/api/garden.yml index 84553c7cf8..d7d716520b 100644 --- a/core/test/data/test-projects/helm/api/garden.yml +++ b/core/test/data/test-projects/helm/api/garden.yml @@ -15,7 +15,7 @@ spec: values: image: repository: api-image - tag: ${action.build.api-image.version} + tag: ${actions.build.api-image.version} ingress: enabled: true paths: [/] diff --git a/core/test/data/test-projects/kubernetes-module/with-source-module/garden.yml b/core/test/data/test-projects/kubernetes-module/with-source-module/garden.yml index c462af6815..a28576c769 100644 --- a/core/test/data/test-projects/kubernetes-module/with-source-module/garden.yml +++ b/core/test/data/test-projects/kubernetes-module/with-source-module/garden.yml @@ -40,7 +40,7 @@ spec: spec: containers: - name: api - image: ${action.build.api-image.outputs.deployment-image-id} + image: ${actions.build.api-image.outputs.deployment-image-id} args: [python, app.py] ports: - containerPort: 80 diff --git a/core/test/unit/src/actions/action-configs-to-graph.ts b/core/test/unit/src/actions/action-configs-to-graph.ts index d1e11f0876..e3d6a11f58 100644 --- a/core/test/unit/src/actions/action-configs-to-graph.ts +++ b/core/test/unit/src/actions/action-configs-to-graph.ts @@ -296,7 +296,7 @@ describe("actionConfigsToGraph", () => { basePath: tmpDir.path, }, spec: { - command: ["echo", "${action.build.foo.version}"], + command: ["echo", "${actions.build.foo.version}"], }, }, ], @@ -313,7 +313,7 @@ describe("actionConfigsToGraph", () => { explicit: false, kind: "Build", name: "foo", - fullRef: ["action", "build", "foo", "version"], + fullRef: ["actions", "build", "foo", "version"], needsExecutedOutputs: false, needsStaticOutputs: true, }, @@ -343,7 +343,7 @@ describe("actionConfigsToGraph", () => { basePath: tmpDir.path, }, spec: { - command: ["echo", "${action.build.foo.outputs.bar}"], + command: ["echo", "${actions.build.foo.outputs.bar}"], }, }, ], @@ -360,7 +360,7 @@ describe("actionConfigsToGraph", () => { explicit: false, kind: "Build", name: "foo", - fullRef: ["action", "build", "foo", "outputs", "bar"], + fullRef: ["actions", "build", "foo", "outputs", "bar"], needsExecutedOutputs: true, needsStaticOutputs: false, }, diff --git a/core/test/unit/src/tasks/resolve-action.ts b/core/test/unit/src/tasks/resolve-action.ts index c4b0a27eda..7dfb185bef 100644 --- a/core/test/unit/src/tasks/resolve-action.ts +++ b/core/test/unit/src/tasks/resolve-action.ts @@ -91,7 +91,7 @@ describe("ResolveActionTask", () => { type: "test", name: "foo", spec: { - foo: "${action.build.foo.outputs.something}", + foo: "${actions.build.foo.outputs.something}", }, }, ]) @@ -116,7 +116,7 @@ describe("ResolveActionTask", () => { type: "test", name: "foo", spec: { - foo: "${action.build.foo.version}", + foo: "${actions.build.foo.version}", }, }, ]) @@ -258,7 +258,7 @@ describe("ResolveActionTask", () => { type: "test", name: "foo", spec: { - deployCommand: ["echo", "${action.build.foo.version}"], + deployCommand: ["echo", "${actions.build.foo.version}"], }, }, ]) @@ -290,7 +290,7 @@ describe("ResolveActionTask", () => { type: "test", name: "foo", spec: { - foo: "${action.build.foo.version}", + foo: "${actions.build.foo.version}", }, }, ]) @@ -419,7 +419,7 @@ describe("ResolveActionTask", () => { type: "test", name: "foo", spec: { - deployCommand: ["echo", "${action.run.foo.outputs.log}"], + deployCommand: ["echo", "${actions.run.foo.outputs.log}"], }, }, ]) diff --git a/core/test/unit/src/template-string.ts b/core/test/unit/src/template-string.ts index 9d3942cfb8..8f2a918f18 100644 --- a/core/test/unit/src/template-string.ts +++ b/core/test/unit/src/template-string.ts @@ -1683,42 +1683,42 @@ describe("collectTemplateReferences", () => { }) describe("getActionTemplateReferences", () => { - context("action.*", () => { + context("actions.*", () => { it("returns valid action references", () => { const config = { - build: '${action["build"].build-a}', - deploy: '${action["deploy"].deploy-a}', - run: '${action["run"].run-a}', - test: '${action["test"].test-a}', + build: '${actions["build"].build-a}', + deploy: '${actions["deploy"].deploy-a}', + run: '${actions["run"].run-a}', + test: '${actions["test"].test-a}', } const actionTemplateReferences = getActionTemplateReferences(config) expect(actionTemplateReferences).to.eql([ { kind: "Build", name: "build-a", - fullRef: ["action", "build", "build-a"], + fullRef: ["actions", "build", "build-a"], }, { kind: "Deploy", name: "deploy-a", - fullRef: ["action", "deploy", "deploy-a"], + fullRef: ["actions", "deploy", "deploy-a"], }, { kind: "Run", name: "run-a", - fullRef: ["action", "run", "run-a"], + fullRef: ["actions", "run", "run-a"], }, { kind: "Test", name: "test-a", - fullRef: ["action", "test", "test-a"], + fullRef: ["actions", "test", "test-a"], }, ]) }) it("throws if action ref has no kind", () => { const config = { - foo: "${action}", + foo: "${actions}", } void expectError(() => getActionTemplateReferences(config), { contains: "Found invalid action reference (missing kind)", @@ -1727,7 +1727,7 @@ describe("getActionTemplateReferences", () => { it("throws if action ref has invalid kind", () => { const config = { - foo: '${action["badkind"].some-name}', + foo: '${actions["badkind"].some-name}', } void expectError(() => getActionTemplateReferences(config), { contains: "Found invalid action reference (invalid kind 'badkind')", @@ -1736,7 +1736,7 @@ describe("getActionTemplateReferences", () => { it("throws if action kind is not a string", () => { const config = { - foo: "${action[123]}", + foo: "${actions[123]}", } void expectError(() => getActionTemplateReferences(config), { contains: "Found invalid action reference (kind is not a string)", @@ -1745,7 +1745,7 @@ describe("getActionTemplateReferences", () => { it("throws if action kind is not resolvable", () => { const config = { - foo: "${action[foo.bar].some-name}", + foo: "${actions[foo.bar].some-name}", } void expectError(() => getActionTemplateReferences(config), { contains: "Found invalid action reference (invalid kind '${foo.bar}')", @@ -1754,7 +1754,7 @@ describe("getActionTemplateReferences", () => { it("throws if action ref has no name", () => { const config = { - foo: '${action["build"]}', + foo: '${actions["build"]}', } void expectError(() => getActionTemplateReferences(config), { contains: "Found invalid action reference (missing name)", @@ -1763,7 +1763,7 @@ describe("getActionTemplateReferences", () => { it("throws if action name is not a string", () => { const config = { - foo: '${action["build"].123}', + foo: '${actions["build"].123}', } void expectError(() => getActionTemplateReferences(config), { contains: "Found invalid action reference (name is not a string)", diff --git a/docs/k8s-plugins/action-types/helm.md b/docs/k8s-plugins/action-types/helm.md index e323e3fe3c..51c8bcb885 100644 --- a/docs/k8s-plugins/action-types/helm.md +++ b/docs/k8s-plugins/action-types/helm.md @@ -84,7 +84,7 @@ type: helm-pod dependencies: - deploy.api variables: - hostname: vote.${var.baseHostname} + hostname: vote.${var.baseHostname} timeout: 60 spec: resource: @@ -167,8 +167,8 @@ dependencies: [build.worker-image] spec: values: image: - repository: ${action.build.worker-image.outputs.deployment-image-name} - tag: ${action.build.worker-image.version} + repository: ${actions.build.worker-image.outputs.deployment-image-name} + tag: ${actions.build.worker-image.version} ``` @@ -195,7 +195,7 @@ spec: sync: paths: - containerPath: /app/src - sourcePath: ${action.build.vote-image.sourcePath}/src + sourcePath: ${actions.build.vote-image.sourcePath}/src mode: two-way ``` @@ -216,7 +216,7 @@ You can define a remote environment as a `production` environment by setting the ## Next steps -Check out the full [action reference](../../reference/action-types/README.md) for more details +Check out the full [action reference](../../reference/action-types/README.md) for more details and the [vote-helm](../../../examples/vote-helm/README.md) example project for a full project that showcases Garden's Helm support. diff --git a/docs/k8s-plugins/action-types/kubernetes.md b/docs/k8s-plugins/action-types/kubernetes.md index a3e36cdc1b..0ae91cb55b 100644 --- a/docs/k8s-plugins/action-types/kubernetes.md +++ b/docs/k8s-plugins/action-types/kubernetes.md @@ -14,7 +14,7 @@ you'll find a lot common between the two guides. See the full spec for the `kubernetes` deploy action in our [reference docs](../../reference/action-types/Deploy/kubernetes.md). -[`kubernetes-pod` run](../../reference/action-types/Run/kubernetes-pod.md), [`kubernetes-pod` test](../../reference/action-types/Test/kubernetes-pod.md) and `kubernetes-exec` +[`kubernetes-pod` run](../../reference/action-types/Run/kubernetes-pod.md), [`kubernetes-pod` test](../../reference/action-types/Test/kubernetes-pod.md) and `kubernetes-exec` actions can be used for testing and task porposes. ## Referencing manifests @@ -169,7 +169,7 @@ type: kubernetes-pod dependencies: - deploy.api variables: - hostname: vote.${var.baseHostname} + hostname: vote.${var.baseHostname} timeout: 60 spec: resource: @@ -208,7 +208,7 @@ spec: spec: containers: - name: worker - image: ${action.build.worker-image.outputs.deployment-image-id} # <--- Here we're referencing the output from the api-image module. This will also work in manifest files. + image: ${actions.build.worker-image.outputs.deployment-image-id} # <--- Here we're referencing the output from the api-image module. This will also work in manifest files. # ... ``` @@ -232,7 +232,7 @@ spec: sync: paths: - containerPath: /app/src - sourcePath: ${action.build.vote-image.sourcePath}/src + sourcePath: ${actions.build.vote-image.sourcePath}/src mode: two-way ``` diff --git a/docs/reference/action-types/Deploy/helm.md b/docs/reference/action-types/Deploy/helm.md index 4721692c4a..856bf96f67 100644 --- a/docs/reference/action-types/Deploy/helm.md +++ b/docs/reference/action-types/Deploy/helm.md @@ -336,8 +336,8 @@ spec: # defined. # # This should generally be a templated path to another action's source path (e.g. - # `${action.build.my-container-image.sourcePath}`), or a relative path. If a path is hard-coded, you must make - # sure the path exists, and that it is reliably the correct path for every user. + # `${actions.build.my-container-image.sourcePath}`), or a relative path. If a path is hard-coded, you must + # make sure the path exists, and that it is reliably the correct path for every user. sourcePath: . # POSIX-style absolute path to sync to inside the container. The root path (i.e. "/") is not allowed. @@ -1126,7 +1126,7 @@ The name of a container in the target. Specify this if the target contains more The local path to sync from, either absolute or relative to the source directory where the Deploy action is defined. -This should generally be a templated path to another action's source path (e.g. `${action.build.my-container-image.sourcePath}`), or a relative path. If a path is hard-coded, you must make sure the path exists, and that it is reliably the correct path for every user. +This should generally be a templated path to another action's source path (e.g. `${actions.build.my-container-image.sourcePath}`), or a relative path. If a path is hard-coded, you must make sure the path exists, and that it is reliably the correct path for every user. | Type | Default | Required | | ----------- | ------- | -------- | diff --git a/docs/reference/action-types/Deploy/kubernetes.md b/docs/reference/action-types/Deploy/kubernetes.md index 17137b7912..5d6eae0e14 100644 --- a/docs/reference/action-types/Deploy/kubernetes.md +++ b/docs/reference/action-types/Deploy/kubernetes.md @@ -318,8 +318,8 @@ spec: # defined. # # This should generally be a templated path to another action's source path (e.g. - # `${action.build.my-container-image.sourcePath}`), or a relative path. If a path is hard-coded, you must make - # sure the path exists, and that it is reliably the correct path for every user. + # `${actions.build.my-container-image.sourcePath}`), or a relative path. If a path is hard-coded, you must + # make sure the path exists, and that it is reliably the correct path for every user. sourcePath: . # POSIX-style absolute path to sync to inside the container. The root path (i.e. "/") is not allowed. @@ -1070,7 +1070,7 @@ The name of a container in the target. Specify this if the target contains more The local path to sync from, either absolute or relative to the source directory where the Deploy action is defined. -This should generally be a templated path to another action's source path (e.g. `${action.build.my-container-image.sourcePath}`), or a relative path. If a path is hard-coded, you must make sure the path exists, and that it is reliably the correct path for every user. +This should generally be a templated path to another action's source path (e.g. `${actions.build.my-container-image.sourcePath}`), or a relative path. If a path is hard-coded, you must make sure the path exists, and that it is reliably the correct path for every user. | Type | Default | Required | | ----------- | ------- | -------- | diff --git a/docs/reference/template-strings/action-specs.md b/docs/reference/template-strings/action-specs.md index 18af90682f..6188616fb4 100644 --- a/docs/reference/template-strings/action-specs.md +++ b/docs/reference/template-strings/action-specs.md @@ -1215,7 +1215,7 @@ Example: my-variable: ${runtime.tasks..version} ``` -### `${action.*}` +### `${actions.*}` Runtime outputs and information from other actions (only resolved at runtime when executing actions). @@ -1223,7 +1223,7 @@ Runtime outputs and information from other actions (only resolved at runtime whe | -------- | | `object` | -### `${action.build.*}` +### `${actions.build.*}` Information about a Build action dependency, including its outputs. @@ -1231,7 +1231,7 @@ Information about a Build action dependency, including its outputs. | -------- | ------- | | `object` | `{}` | -### `${action.build..name}` +### `${actions.build..name}` The name of the action. @@ -1239,7 +1239,7 @@ The name of the action. | -------- | | `string` | -### `${action.build..disabled}` +### `${actions.build..disabled}` Whether the action is disabled. @@ -1250,10 +1250,10 @@ Whether the action is disabled. Example: ```yaml -my-variable: ${action.build..disabled} +my-variable: ${actions.build..disabled} ``` -### `${action.build..buildPath}` +### `${actions.build..buildPath}` The local path to the action build directory. @@ -1264,10 +1264,10 @@ The local path to the action build directory. Example: ```yaml -my-variable: ${action.build..buildPath} +my-variable: ${actions.build..buildPath} ``` -### `${action.build..sourcePath}` +### `${actions.build..sourcePath}` The local path to the action source directory. @@ -1278,10 +1278,10 @@ The local path to the action source directory. Example: ```yaml -my-variable: ${action.build..sourcePath} +my-variable: ${actions.build..sourcePath} ``` -### `${action.build..mode}` +### `${actions.build..mode}` The mode that the action should be executed in (e.g. 'sync' or 'local' for Deploy actions). Set to 'default' if no special mode is being used. @@ -1292,10 +1292,10 @@ The mode that the action should be executed in (e.g. 'sync' or 'local' for Deplo Example: ```yaml -my-variable: ${action.build..mode} +my-variable: ${actions.build..mode} ``` -### `${action.build..var.*}` +### `${actions.build..var.*}` The variables configured on the action. @@ -1303,13 +1303,13 @@ The variables configured on the action. | -------- | ------- | | `object` | `{}` | -### `${action.build..var.}` +### `${actions.build..var.}` | Type | | ---------------------------------------------------- | | `string \| number \| boolean \| link \| array[link]` | -### `${action.build..outputs.*}` +### `${actions.build..outputs.*}` The outputs defined by the action (see individual action/module type [references](https://docs.garden.io/reference) for details). @@ -1317,7 +1317,7 @@ The outputs defined by the action (see individual action/module type [references | -------- | ------- | | `object` | `{}` | -### `${action.build..outputs.}` +### `${actions.build..outputs.}` The action output value. Refer to individual [action/module type references](https://docs.garden.io/reference) for details. @@ -1325,7 +1325,7 @@ The action output value. Refer to individual [action/module type references](htt | ----------------------------- | | `string \| number \| boolean` | -### `${action.build..version}` +### `${actions.build..version}` The current version of the action. @@ -1336,10 +1336,10 @@ The current version of the action. Example: ```yaml -my-variable: ${action.build..version} +my-variable: ${actions.build..version} ``` -### `${action.deploy.*}` +### `${actions.deploy.*}` Information about a Deploy action dependency, including its outputs. @@ -1347,7 +1347,7 @@ Information about a Deploy action dependency, including its outputs. | -------- | ------- | | `object` | `{}` | -### `${action.deploy..name}` +### `${actions.deploy..name}` The name of the action. @@ -1355,7 +1355,7 @@ The name of the action. | -------- | | `string` | -### `${action.deploy..disabled}` +### `${actions.deploy..disabled}` Whether the action is disabled. @@ -1366,10 +1366,10 @@ Whether the action is disabled. Example: ```yaml -my-variable: ${action.deploy..disabled} +my-variable: ${actions.deploy..disabled} ``` -### `${action.deploy..buildPath}` +### `${actions.deploy..buildPath}` The local path to the action build directory. @@ -1380,10 +1380,10 @@ The local path to the action build directory. Example: ```yaml -my-variable: ${action.deploy..buildPath} +my-variable: ${actions.deploy..buildPath} ``` -### `${action.deploy..sourcePath}` +### `${actions.deploy..sourcePath}` The local path to the action source directory. @@ -1394,10 +1394,10 @@ The local path to the action source directory. Example: ```yaml -my-variable: ${action.deploy..sourcePath} +my-variable: ${actions.deploy..sourcePath} ``` -### `${action.deploy..mode}` +### `${actions.deploy..mode}` The mode that the action should be executed in (e.g. 'sync' or 'local' for Deploy actions). Set to 'default' if no special mode is being used. @@ -1408,10 +1408,10 @@ The mode that the action should be executed in (e.g. 'sync' or 'local' for Deplo Example: ```yaml -my-variable: ${action.deploy..mode} +my-variable: ${actions.deploy..mode} ``` -### `${action.deploy..var.*}` +### `${actions.deploy..var.*}` The variables configured on the action. @@ -1419,13 +1419,13 @@ The variables configured on the action. | -------- | ------- | | `object` | `{}` | -### `${action.deploy..var.}` +### `${actions.deploy..var.}` | Type | | ---------------------------------------------------- | | `string \| number \| boolean \| link \| array[link]` | -### `${action.deploy..outputs.*}` +### `${actions.deploy..outputs.*}` The outputs defined by the action (see individual action/module type [references](https://docs.garden.io/reference) for details). @@ -1433,7 +1433,7 @@ The outputs defined by the action (see individual action/module type [references | -------- | ------- | | `object` | `{}` | -### `${action.deploy..outputs.}` +### `${actions.deploy..outputs.}` The action output value. Refer to individual [action/module type references](https://docs.garden.io/reference) for details. @@ -1441,7 +1441,7 @@ The action output value. Refer to individual [action/module type references](htt | ----------------------------- | | `string \| number \| boolean` | -### `${action.deploy..version}` +### `${actions.deploy..version}` The current version of the action. @@ -1452,10 +1452,10 @@ The current version of the action. Example: ```yaml -my-variable: ${action.deploy..version} +my-variable: ${actions.deploy..version} ``` -### `${action.run.*}` +### `${actions.run.*}` Information about a Run action dependency, including its outputs. @@ -1463,7 +1463,7 @@ Information about a Run action dependency, including its outputs. | -------- | ------- | | `object` | `{}` | -### `${action.run..name}` +### `${actions.run..name}` The name of the action. @@ -1471,7 +1471,7 @@ The name of the action. | -------- | | `string` | -### `${action.run..disabled}` +### `${actions.run..disabled}` Whether the action is disabled. @@ -1482,10 +1482,10 @@ Whether the action is disabled. Example: ```yaml -my-variable: ${action.run..disabled} +my-variable: ${actions.run..disabled} ``` -### `${action.run..buildPath}` +### `${actions.run..buildPath}` The local path to the action build directory. @@ -1496,10 +1496,10 @@ The local path to the action build directory. Example: ```yaml -my-variable: ${action.run..buildPath} +my-variable: ${actions.run..buildPath} ``` -### `${action.run..sourcePath}` +### `${actions.run..sourcePath}` The local path to the action source directory. @@ -1510,10 +1510,10 @@ The local path to the action source directory. Example: ```yaml -my-variable: ${action.run..sourcePath} +my-variable: ${actions.run..sourcePath} ``` -### `${action.run..mode}` +### `${actions.run..mode}` The mode that the action should be executed in (e.g. 'sync' or 'local' for Deploy actions). Set to 'default' if no special mode is being used. @@ -1524,10 +1524,10 @@ The mode that the action should be executed in (e.g. 'sync' or 'local' for Deplo Example: ```yaml -my-variable: ${action.run..mode} +my-variable: ${actions.run..mode} ``` -### `${action.run..var.*}` +### `${actions.run..var.*}` The variables configured on the action. @@ -1535,13 +1535,13 @@ The variables configured on the action. | -------- | ------- | | `object` | `{}` | -### `${action.run..var.}` +### `${actions.run..var.}` | Type | | ---------------------------------------------------- | | `string \| number \| boolean \| link \| array[link]` | -### `${action.run..outputs.*}` +### `${actions.run..outputs.*}` The outputs defined by the action (see individual action/module type [references](https://docs.garden.io/reference) for details). @@ -1549,7 +1549,7 @@ The outputs defined by the action (see individual action/module type [references | -------- | ------- | | `object` | `{}` | -### `${action.run..outputs.}` +### `${actions.run..outputs.}` The action output value. Refer to individual [action/module type references](https://docs.garden.io/reference) for details. @@ -1557,7 +1557,7 @@ The action output value. Refer to individual [action/module type references](htt | ----------------------------- | | `string \| number \| boolean` | -### `${action.run..version}` +### `${actions.run..version}` The current version of the action. @@ -1568,10 +1568,10 @@ The current version of the action. Example: ```yaml -my-variable: ${action.run..version} +my-variable: ${actions.run..version} ``` -### `${action.test.*}` +### `${actions.test.*}` Information about a Test action dependency, including its outputs. @@ -1579,7 +1579,7 @@ Information about a Test action dependency, including its outputs. | -------- | ------- | | `object` | `{}` | -### `${action.test..name}` +### `${actions.test..name}` The name of the action. @@ -1587,7 +1587,7 @@ The name of the action. | -------- | | `string` | -### `${action.test..disabled}` +### `${actions.test..disabled}` Whether the action is disabled. @@ -1598,10 +1598,10 @@ Whether the action is disabled. Example: ```yaml -my-variable: ${action.test..disabled} +my-variable: ${actions.test..disabled} ``` -### `${action.test..buildPath}` +### `${actions.test..buildPath}` The local path to the action build directory. @@ -1612,10 +1612,10 @@ The local path to the action build directory. Example: ```yaml -my-variable: ${action.test..buildPath} +my-variable: ${actions.test..buildPath} ``` -### `${action.test..sourcePath}` +### `${actions.test..sourcePath}` The local path to the action source directory. @@ -1626,10 +1626,10 @@ The local path to the action source directory. Example: ```yaml -my-variable: ${action.test..sourcePath} +my-variable: ${actions.test..sourcePath} ``` -### `${action.test..mode}` +### `${actions.test..mode}` The mode that the action should be executed in (e.g. 'sync' or 'local' for Deploy actions). Set to 'default' if no special mode is being used. @@ -1640,10 +1640,10 @@ The mode that the action should be executed in (e.g. 'sync' or 'local' for Deplo Example: ```yaml -my-variable: ${action.test..mode} +my-variable: ${actions.test..mode} ``` -### `${action.test..var.*}` +### `${actions.test..var.*}` The variables configured on the action. @@ -1651,13 +1651,13 @@ The variables configured on the action. | -------- | ------- | | `object` | `{}` | -### `${action.test..var.}` +### `${actions.test..var.}` | Type | | ---------------------------------------------------- | | `string \| number \| boolean \| link \| array[link]` | -### `${action.test..outputs.*}` +### `${actions.test..outputs.*}` The outputs defined by the action (see individual action/module type [references](https://docs.garden.io/reference) for details). @@ -1665,7 +1665,7 @@ The outputs defined by the action (see individual action/module type [references | -------- | ------- | | `object` | `{}` | -### `${action.test..outputs.}` +### `${actions.test..outputs.}` The action output value. Refer to individual [action/module type references](https://docs.garden.io/reference) for details. @@ -1673,7 +1673,7 @@ The action output value. Refer to individual [action/module type references](htt | ----------------------------- | | `string \| number \| boolean` | -### `${action.test..version}` +### `${actions.test..version}` The current version of the action. @@ -1684,10 +1684,10 @@ The current version of the action. Example: ```yaml -my-variable: ${action.test..version} +my-variable: ${actions.test..version} ``` -### `${action.services.*}` +### `${actions.services.*}` Alias for `deploy`. @@ -1695,7 +1695,7 @@ Alias for `deploy`. | -------- | ------- | | `object` | `{}` | -### `${action.services..name}` +### `${actions.services..name}` The name of the action. @@ -1703,7 +1703,7 @@ The name of the action. | -------- | | `string` | -### `${action.services..disabled}` +### `${actions.services..disabled}` Whether the action is disabled. @@ -1714,10 +1714,10 @@ Whether the action is disabled. Example: ```yaml -my-variable: ${action.services..disabled} +my-variable: ${actions.services..disabled} ``` -### `${action.services..buildPath}` +### `${actions.services..buildPath}` The local path to the action build directory. @@ -1728,10 +1728,10 @@ The local path to the action build directory. Example: ```yaml -my-variable: ${action.services..buildPath} +my-variable: ${actions.services..buildPath} ``` -### `${action.services..sourcePath}` +### `${actions.services..sourcePath}` The local path to the action source directory. @@ -1742,10 +1742,10 @@ The local path to the action source directory. Example: ```yaml -my-variable: ${action.services..sourcePath} +my-variable: ${actions.services..sourcePath} ``` -### `${action.services..mode}` +### `${actions.services..mode}` The mode that the action should be executed in (e.g. 'sync' or 'local' for Deploy actions). Set to 'default' if no special mode is being used. @@ -1756,10 +1756,10 @@ The mode that the action should be executed in (e.g. 'sync' or 'local' for Deplo Example: ```yaml -my-variable: ${action.services..mode} +my-variable: ${actions.services..mode} ``` -### `${action.services..var.*}` +### `${actions.services..var.*}` The variables configured on the action. @@ -1767,13 +1767,13 @@ The variables configured on the action. | -------- | ------- | | `object` | `{}` | -### `${action.services..var.}` +### `${actions.services..var.}` | Type | | ---------------------------------------------------- | | `string \| number \| boolean \| link \| array[link]` | -### `${action.services..outputs.*}` +### `${actions.services..outputs.*}` The outputs defined by the action (see individual action/module type [references](https://docs.garden.io/reference) for details). @@ -1781,7 +1781,7 @@ The outputs defined by the action (see individual action/module type [references | -------- | ------- | | `object` | `{}` | -### `${action.services..outputs.}` +### `${actions.services..outputs.}` The action output value. Refer to individual [action/module type references](https://docs.garden.io/reference) for details. @@ -1789,7 +1789,7 @@ The action output value. Refer to individual [action/module type references](htt | ----------------------------- | | `string \| number \| boolean` | -### `${action.services..version}` +### `${actions.services..version}` The current version of the action. @@ -1800,10 +1800,10 @@ The current version of the action. Example: ```yaml -my-variable: ${action.services..version} +my-variable: ${actions.services..version} ``` -### `${action.tasks.*}` +### `${actions.tasks.*}` Alias for `run`. @@ -1811,7 +1811,7 @@ Alias for `run`. | -------- | ------- | | `object` | `{}` | -### `${action.tasks..name}` +### `${actions.tasks..name}` The name of the action. @@ -1819,7 +1819,7 @@ The name of the action. | -------- | | `string` | -### `${action.tasks..disabled}` +### `${actions.tasks..disabled}` Whether the action is disabled. @@ -1830,10 +1830,10 @@ Whether the action is disabled. Example: ```yaml -my-variable: ${action.tasks..disabled} +my-variable: ${actions.tasks..disabled} ``` -### `${action.tasks..buildPath}` +### `${actions.tasks..buildPath}` The local path to the action build directory. @@ -1844,10 +1844,10 @@ The local path to the action build directory. Example: ```yaml -my-variable: ${action.tasks..buildPath} +my-variable: ${actions.tasks..buildPath} ``` -### `${action.tasks..sourcePath}` +### `${actions.tasks..sourcePath}` The local path to the action source directory. @@ -1858,10 +1858,10 @@ The local path to the action source directory. Example: ```yaml -my-variable: ${action.tasks..sourcePath} +my-variable: ${actions.tasks..sourcePath} ``` -### `${action.tasks..mode}` +### `${actions.tasks..mode}` The mode that the action should be executed in (e.g. 'sync' or 'local' for Deploy actions). Set to 'default' if no special mode is being used. @@ -1872,10 +1872,10 @@ The mode that the action should be executed in (e.g. 'sync' or 'local' for Deplo Example: ```yaml -my-variable: ${action.tasks..mode} +my-variable: ${actions.tasks..mode} ``` -### `${action.tasks..var.*}` +### `${actions.tasks..var.*}` The variables configured on the action. @@ -1883,13 +1883,13 @@ The variables configured on the action. | -------- | ------- | | `object` | `{}` | -### `${action.tasks..var.}` +### `${actions.tasks..var.}` | Type | | ---------------------------------------------------- | | `string \| number \| boolean \| link \| array[link]` | -### `${action.tasks..outputs.*}` +### `${actions.tasks..outputs.*}` The outputs defined by the action (see individual action/module type [references](https://docs.garden.io/reference) for details). @@ -1897,7 +1897,7 @@ The outputs defined by the action (see individual action/module type [references | -------- | ------- | | `object` | `{}` | -### `${action.tasks..outputs.}` +### `${actions.tasks..outputs.}` The action output value. Refer to individual [action/module type references](https://docs.garden.io/reference) for details. @@ -1905,7 +1905,7 @@ The action output value. Refer to individual [action/module type references](htt | ----------------------------- | | `string \| number \| boolean` | -### `${action.tasks..version}` +### `${actions.tasks..version}` The current version of the action. @@ -1916,7 +1916,7 @@ The current version of the action. Example: ```yaml -my-variable: ${action.tasks..version} +my-variable: ${actions.tasks..version} ``` ### `${inputs.*}` diff --git a/docs/using-garden/config-templates.md b/docs/using-garden/config-templates.md index 7951abbfed..d7db8b568d 100644 --- a/docs/using-garden/config-templates.md +++ b/docs/using-garden/config-templates.md @@ -114,14 +114,14 @@ Here's a section from the manifests in our example: ... containers: - name: main - image: ${action.build["${parent.name}"].outputs.deployment-image-id} + image: ${actions.build["${parent.name}"].outputs.deployment-image-id} imagePullPolicy: "Always" ports: - name: http containerPort: ${inputs.containerPort} ``` -Notice the `image` field above. We use bracket notation to template the action name, whose outputs we want to reference: `${action.build["${parent.name}"].outputs.deployment-image-id}`. Here we're using that to get the built image ID of the `${parent.name}` Build in the same template. +Notice the `image` field above. We use bracket notation to template the action name, whose outputs we want to reference: `${actions.build["${parent.name}"].outputs.deployment-image-id}`. Here we're using that to get the built image ID of the `${parent.name}` Build in the same template. _Note that for a reference like this to work, that action also needs to be specified as a dependency._ diff --git a/docs/using-garden/projects.md b/docs/using-garden/projects.md index 4bea2ba794..2948ff6c24 100644 --- a/docs/using-garden/projects.md +++ b/docs/using-garden/projects.md @@ -112,7 +112,7 @@ kind: Project name: my-project ... outputs: - my-action-image: ${action.build.my-image.outputs.deployment-image-id} + my-action-image: ${actions.build.my-image.outputs.deployment-image-id} ``` You can then retrieve this value by running e.g. `garden get outputs -o json` and parsing the output with `jq`. diff --git a/examples/base-image/README.md b/examples/base-image/README.md index 9fbb2749bc..6a62589a63 100644 --- a/examples/base-image/README.md +++ b/examples/base-image/README.md @@ -33,7 +33,7 @@ name: backend # Corresponds to the ARG directive in the Dockerfile. spec: buildArgs: - BASE_IMAGE_VERSION: ${action.build.base-image.version} + BASE_IMAGE_VERSION: ${actions.build.base-image.version} ``` and diff --git a/examples/base-image/backend/backend.garden.yml b/examples/base-image/backend/backend.garden.yml index 8564c4c8fa..740cc2466f 100644 --- a/examples/base-image/backend/backend.garden.yml +++ b/examples/base-image/backend/backend.garden.yml @@ -9,7 +9,7 @@ spec: # The build arguments to use when building the image. # Corresponds to the ARG directive in the Dockerfile. buildArgs: - BASE_IMAGE_VERSION: ${action.build.base-image.version} + BASE_IMAGE_VERSION: ${actions.build.base-image.version} --- diff --git a/examples/local-mode-helm/backend/garden.yml b/examples/local-mode-helm/backend/garden.yml index 51e9bbbde5..940b374f52 100644 --- a/examples/local-mode-helm/backend/garden.yml +++ b/examples/local-mode-helm/backend/garden.yml @@ -19,8 +19,8 @@ spec: values: image: - repository: ${action.build.backend-image.outputs.deployment-image-name} - tag: ${action.build.backend-image.version} + repository: ${actions.build.backend-image.outputs.deployment-image-name} + tag: ${actions.build.backend-image.version} ingress: enabled: true paths: [ "/hello-backend" ] diff --git a/examples/local-mode-k8s/backend/garden.yml b/examples/local-mode-k8s/backend/garden.yml index 05ebf54a4a..cc23f7ca3e 100644 --- a/examples/local-mode-k8s/backend/garden.yml +++ b/examples/local-mode-k8s/backend/garden.yml @@ -52,7 +52,7 @@ spec: spec: containers: - name: backend - image: ${action.build.backend-image.outputs.deployment-image-id} + image: ${actions.build.backend-image.outputs.deployment-image-id} ports: - name: http protocol: TCP diff --git a/examples/local-service/README.md b/examples/local-service/README.md index 9109c31246..c2ad52fc5f 100644 --- a/examples/local-service/README.md +++ b/examples/local-service/README.md @@ -45,7 +45,7 @@ spec: command: ["yarn", "run", "dev"] # <--- This is the command Garden runs to start the process in sync mode statusCommand: [./check-local-status.sh] # <--- Optionally set a status command that checks whether the local service is ready deployCommand: [] # <--- A no op since we only want to deploy it when we're in sync mode - env: ${action.deploy.frontend.env} # <--- Reference the env variable defined above + env: ${actions.deploy.frontend.env} # <--- Reference the env variable defined above ``` In the config above the `local-frontend` deploy action is always enabled when in sync mode, but you can choose to conditionally enable it as well. diff --git a/examples/local-service/frontend/garden.yml b/examples/local-service/frontend/garden.yml index e5dc7ecaa0..c5995753c1 100644 --- a/examples/local-service/frontend/garden.yml +++ b/examples/local-service/frontend/garden.yml @@ -46,7 +46,7 @@ dependencies: spec: args: [ npm, test ] - env: ${action.deploy.frontend.var.env} + env: ${actions.deploy.frontend.var.env} --- kind: Test @@ -60,7 +60,7 @@ dependencies: spec: args: [ npm, run, integ ] - env: ${action.deploy.frontend.var.env} + env: ${actions.deploy.frontend.var.env} --- kind: Build @@ -81,4 +81,4 @@ spec: command: [ "yarn", "run", "dev" ] statusCommand: [ ./check-local-status.sh ] deployCommand: [ ] - env: ${action.deploy.frontend.var.env} + env: ${actions.deploy.frontend.var.env} diff --git a/examples/templated-k8s-container/template/garden.yml b/examples/templated-k8s-container/template/garden.yml index b16a7c4a64..6b8079bf90 100644 --- a/examples/templated-k8s-container/template/garden.yml +++ b/examples/templated-k8s-container/template/garden.yml @@ -51,7 +51,7 @@ configs: spec: containers: - name: main - image: ${action.build["${parent.name}"].outputs.deployment-image-id} + image: ${actions.build["${parent.name}"].outputs.deployment-image-id} imagePullPolicy: "Always" ports: - name: http diff --git a/examples/vote-helm/api.garden.yml b/examples/vote-helm/api.garden.yml index aa427cd076..5f66b9f317 100644 --- a/examples/vote-helm/api.garden.yml +++ b/examples/vote-helm/api.garden.yml @@ -11,8 +11,8 @@ spec: values: name: api image: - repository: ${action.build.api-image.outputs.deployment-image-name} - tag: ${action.build.api-image.version} + repository: ${actions.build.api-image.outputs.deployment-image-name} + tag: ${actions.build.api-image.version} ingress: enabled: true paths: [/] diff --git a/examples/vote-helm/result.garden.yml b/examples/vote-helm/result.garden.yml index 522589806d..8ecf09a0d8 100644 --- a/examples/vote-helm/result.garden.yml +++ b/examples/vote-helm/result.garden.yml @@ -11,8 +11,8 @@ spec: values: name: result image: - repository: ${action.build.result-image.outputs.deployment-image-name} - tag: ${action.build.result-image.version} + repository: ${actions.build.result-image.outputs.deployment-image-name} + tag: ${actions.build.result-image.version} ingress: enabled: true paths: [/] diff --git a/examples/vote-helm/vote/garden.yml b/examples/vote-helm/vote/garden.yml index 4657b69db3..693f23b379 100644 --- a/examples/vote-helm/vote/garden.yml +++ b/examples/vote-helm/vote/garden.yml @@ -16,12 +16,12 @@ spec: sync: paths: - containerPath: /app/src - sourcePath: ${action.build.vote-image.sourcePath}/src + sourcePath: ${actions.build.vote-image.sourcePath}/src mode: two-way values: image: - repository: ${action.build.vote-image.outputs.deployment-image-name} - tag: ${action.build.vote-image.version} + repository: ${actions.build.vote-image.outputs.deployment-image-name} + tag: ${actions.build.vote-image.version} ingress: enabled: true paths: [/] @@ -52,7 +52,7 @@ type: helm-pod dependencies: - deploy.api variables: - hostname: vote.${var.baseHostname} + hostname: vote.${var.baseHostname} timeout: 60 spec: resource: @@ -61,8 +61,8 @@ spec: command: [/bin/sh, -c, "npm run test:integ"] values: image: - repository: ${action.build.vote-image.outputs.deployment-image-name} - tag: ${action.build.vote-image.version} + repository: ${actions.build.vote-image.outputs.deployment-image-name} + tag: ${actions.build.vote-image.version} ingress: enabled: true paths: [/] diff --git a/examples/vote-helm/worker/garden.yml b/examples/vote-helm/worker/garden.yml index 6cb5f3c696..ae6726626d 100644 --- a/examples/vote-helm/worker/garden.yml +++ b/examples/vote-helm/worker/garden.yml @@ -6,5 +6,5 @@ dependencies: [build.worker-image] spec: values: image: - repository: ${action.build.worker-image.outputs.deployment-image-name} - tag: ${action.build.worker-image.version} + repository: ${actions.build.worker-image.outputs.deployment-image-name} + tag: ${actions.build.worker-image.version}