refactored existing tests to use #TransformSecret

Signed-off-by: Richard Jones <richard@dagger.io>
This commit is contained in:
Richard Jones
2022-01-04 20:30:58 -07:00
parent 86bf3bad86
commit 86ae230261
2 changed files with 40 additions and 16 deletions

View File

@@ -1,24 +1,36 @@
package main
import "dagger.io/dagger/engine"
import (
"encoding/yaml"
"dagger.io/dagger/engine"
)
engine.#Plan & {
inputs: secrets: token: command: {
inputs: secrets: sops: command: {
name: "sops"
args: ["exec-env", "../../secrets_sops.yaml", "echo $TestPAT"]
args: ["-d", "../../secrets_sops.yaml"]
}
actions: {
alpine: engine.#Pull & {
source: "alpine:3.15.0"
}
repoPassword: engine.#TransformSecret & {
input: inputs.secrets.sops.contents
#function: {
input: _
output: yaml.Unmarshal(input).TestPAT
}
}
testRepo: engine.#GitPull & {
remote: "https://github.com/dagger/dagger.git"
ref: "main"
auth: {
username: "dagger-test"
password: inputs.secrets.token.contents
password: repoPassword.output
}
}