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/pkg/alpha.dagger.io/js/yarn/tests/yarn.cue
Andrea Luzzardi 282759c0e5 cue modules: move stdlib to pkg/alpha.dagger.io
In preparation for Europa, we will vendor multiple CUE modules:

- `pkg/alpha.dagger.io`: legacy non-europa packages
- `pkg/dagger.io`: core Europa packages
- `pkg/universe.dagger.io`: Europa universe

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2022-01-11 13:16:37 -08:00

58 lines
1001 B
CUE

package yarn
import (
"alpha.dagger.io/dagger"
"alpha.dagger.io/alpine"
"alpha.dagger.io/os"
)
TestData: dagger.#Artifact
TestReact: {
pkg: #Package & {
source: TestData
}
test: os.#Container & {
image: alpine.#Image & {
package: bash: true
}
mount: "/build": from: pkg.build
command: """
test "$(cat /build/test)" = "output"
"""
}
}
TestData2: dagger.#Artifact
TestSecretsAndFile: {
pkg: #Package & {
source: TestData2
writeEnvFile: "/.env"
env: {
one: "one"
two: "two"
}
secrets: {
secretone: dagger.#Secret @dagger(input)
secretwo: dagger.#Secret @dagger(input)
}
}
test: os.#Container & {
image: alpine.#Image & {
package: bash: true
}
shell: path: "/bin/bash"
mount: "/build": from: pkg.build
command: """
content="$(cat /build/env)"
[[ "${content}" = *"SECRETONE="* ]] && \\
[[ "${content}" = *"SECRETWO="* ]] && \\
[[ "${content}" = *"ONE=one"* ]] && \\
[[ "${content}" = *"TWO=two"* ]]
"""
}
}