refactored existing tests to use #TransformSecret
Signed-off-by: Richard Jones <richard@dagger.io>
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user