implemented ability to pass #Secret as env var

Signed-off-by: Richard Jones <richard@dagger.io>
This commit is contained in:
Richard Jones
2022-02-04 16:28:20 -07:00
parent e3131671a7
commit 3c57630b0e
8 changed files with 385 additions and 80 deletions

View File

@@ -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

View 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"
"""#,
]
}
}
}

View File

@@ -0,0 +1 @@
hello world