implemented ability to pass #Secret as env var
Signed-off-by: Richard Jones <richard@dagger.io>
This commit is contained in:
@@ -39,6 +39,7 @@ setup() {
|
||||
cd "$TESTDIR"/tasks/exec
|
||||
"$DAGGER" --europa up ./args.cue
|
||||
"$DAGGER" --europa up ./env.cue
|
||||
"$DAGGER" --europa up ./env_secret.cue
|
||||
"$DAGGER" --europa up ./hosts.cue
|
||||
|
||||
"$DAGGER" --europa up ./mount_cache.cue
|
||||
|
25
tests/tasks/exec/env_secret.cue
Normal file
25
tests/tasks/exec/env_secret.cue
Normal file
@@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"dagger.io/dagger/engine"
|
||||
)
|
||||
|
||||
engine.#Plan & {
|
||||
inputs: secrets: testSecret: path: "secret.txt"
|
||||
actions: {
|
||||
image: engine.#Pull & {
|
||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||
}
|
||||
|
||||
verify: engine.#Exec & {
|
||||
input: image.output
|
||||
env: TEST: inputs.secrets.testSecret.contents
|
||||
args: [
|
||||
"sh", "-c",
|
||||
#"""
|
||||
test "$TEST" = "hello world"
|
||||
"""#,
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
1
tests/tasks/exec/secret.txt
Normal file
1
tests/tasks/exec/secret.txt
Normal file
@@ -0,0 +1 @@
|
||||
hello world
|
Reference in New Issue
Block a user