engine: Make paths relative to the CUE file they're defined in
Fixes #1309 Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
committed by
Sam Alba
parent
ec69734c51
commit
9c81a155c9
@@ -5,7 +5,7 @@ import (
|
||||
)
|
||||
|
||||
engine.#Plan & {
|
||||
inputs: directories: test: path: "./plan/inputs/directories"
|
||||
inputs: directories: test: path: "."
|
||||
actions: verify: engine.#ReadFile & {
|
||||
input: inputs.directories.test.contents
|
||||
path: "test.txt"
|
||||
|
@@ -5,7 +5,7 @@ import (
|
||||
)
|
||||
|
||||
engine.#Plan & {
|
||||
inputs: directories: test: path: "./plan/inputs/directories"
|
||||
inputs: directories: test: path: "."
|
||||
actions: verify: engine.#ReadFile & {
|
||||
input: inputs.directories.test.contents
|
||||
path: "test.txt"
|
||||
|
33
tests/plan/inputs/secrets/exec_relative.cue
Normal file
33
tests/plan/inputs/secrets/exec_relative.cue
Normal file
@@ -0,0 +1,33 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"alpha.dagger.io/europa/dagger/engine"
|
||||
)
|
||||
|
||||
engine.#Plan & {
|
||||
inputs: secrets: echo: command: {
|
||||
name: "cat"
|
||||
args: ["./test.txt"]
|
||||
}
|
||||
|
||||
actions: {
|
||||
|
||||
image: engine.#Pull & {
|
||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||
}
|
||||
|
||||
verify: engine.#Exec & {
|
||||
input: image.output
|
||||
mounts: secret: {
|
||||
dest: "/run/secrets/test"
|
||||
contents: inputs.secrets.echo.contents
|
||||
}
|
||||
args: [
|
||||
"sh", "-c",
|
||||
#"""
|
||||
test "$(cat /run/secrets/test)" = "test"
|
||||
"""#,
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
1
tests/plan/inputs/secrets/test.txt
Normal file
1
tests/plan/inputs/secrets/test.txt
Normal file
@@ -0,0 +1 @@
|
||||
test
|
Reference in New Issue
Block a user