This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
dagger/pkg/dagger.io/dagger/utils.cue
Richard Jones a087161fbb implemented #DecodeSecret as engine task
Signed-off-by: Richard Jones <richard@dagger.io>
2022-02-04 14:03:55 -07:00

62 lines
1.2 KiB
CUE

package dagger
import (
// "encoding/json"
// "encoding/yaml"
"dagger.io/dagger/engine"
)
// Access the source directory for the current CUE package
// This may safely be called from any package
#Source: engine.#Source
// A (best effort) persistent cache dir
#CacheDir: engine.#CacheDir
// A temporary directory for command execution
#TempDir: engine.#TempDir
// Select a subdirectory from a filesystem tree
#Subdir: {
// Input tree
input: engine.#FS
// Path of the subdirectory
// Example: "/build"
path: string
// Copy action
_copy: engine.#Copy & {
"input": engine.#Scratch
contents: input
source: path
dest: "/"
}
// Subdirectory tree
output: engine.#FS & _copy.output
}
// DecodeSecret is a convenience wrapper around #TransformSecret. The plain text contents of input is expected to match the format
// #DecodeSecret: {
// {
// format: "json"
// engine.#TransformSecret & {
// #function: {
// input: _
// output: json.Unmarshal(input)
// }
// }
// } | {
// format: "yaml"
// engine.#TransformSecret & {
// #function: {
// input: _
// output: yaml.Unmarshal(input)
// }
// }
// }
// }
#DecodeSecret: engine.#DecodeSecret