brief-restaurant-63679
11/15/2023, 5:13 PMbuild
field on actions. The docs are a little unclear on this:
> Specify a Build action, and resolve this action from the context of that Build.
> For example, you might create an exec Build which prepares some manifests, and then reference that in a kubernetes Deploy action, and the resulting manifests from the Build.
If I e.g. have a Test action of type container that depends on some build, should I specify that here?
Or should I rather just set the image for the Test action like so:
- kind: Test
name: my-test
type: container
dependencies: [my-build]
spec:
image: ${actions.build.my-build.outputs.deploymentImageId}
args: [npm, test]
build
field is set.swift-garage-61180
11/16/2023, 10:58 AMbuild
field is used as the base path of the Test/Run in question.
By default, runtime actions (Tests and Runs) use the base path of the action itself as the working directory for e.g. the CLI tool that's being called in the plugin.
But if build
is set, the base path of that build action is used as the working directory instead.brief-restaurant-63679
11/16/2023, 10:59 AMsource.path
?swift-garage-61180
11/16/2023, 11:00 AMbrief-restaurant-63679
11/16/2023, 11:00 AMcontainer
.
Would it be to have it depend on a Build action and do spec.image
?
Or rather just build the test container "on demand"?swift-garage-61180
11/16/2023, 11:02 AMbuild
field is currently only used for calculating the source path.
So that override can equivalently be provided by setting source.path
, as you say.brief-restaurant-63679
11/16/2023, 11:04 AMTest
that belongs to the template depends on the Build
from the same template, but I can't set the build as a dependency because it would require unresolved template strings in the dep array.- kind: Test
name: ${parent.name}-lint
type: container
dependencies: ["${actions.build['${parent.name}']}"] # <--- This won't work
spec:
image: ${actions.build["${parent.name}"].outputs.deploymentImageId}
args: [npm, run, lint]
swift-garage-61180
11/16/2023, 11:09 AMdependencies: ["${actions.build['${parent.name}']}"] # <--- This won't work
Hmm, do we need that to construct the name of the build to reference in the dependency declaration?
How about
dependencies: ['build.${parent.name}']
... or whatever the formula for the name of the Build action is?brief-restaurant-63679
11/16/2023, 11:12 AMswift-garage-61180
11/16/2023, 11:15 AMbrief-restaurant-63679
11/16/2023, 11:17 AMswift-garage-61180
11/16/2023, 11:30 AM