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.
dagger/docs/tests/core-concepts/client/plans/env.cue
Helder Correia 80ae63928b
feat: Allow default values in client: env (#2122)
Signed-off-by: Helder Correia <174525+helderco@users.noreply.github.com>
2022-04-11 15:31:36 -03:00

26 lines
481 B
CUE

package main
import (
"dagger.io/dagger"
"universe.dagger.io/docker"
)
dagger.#Plan & {
client: env: {
// load as a string
REGISTRY_USER: string
// load as a secret
REGISTRY_TOKEN: dagger.#Secret
// load as a string, using a default if not defined
BASE_IMAGE: string | *"registry.example.com/image"
}
actions: pull: docker.#Pull & {
source: client.env.BASE_IMAGE
auth: {
username: client.env.REGISTRY_USER
secret: client.env.REGISTRY_TOKEN
}
}
}