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/stdlib/.dagger/env/sanity-check/plan/main.cue
Solomon Hykes d7a805f42b stdlib: move all imports to alpha.dagger.io
Signed-off-by: Solomon Hykes <solomon@dagger.io>
2021-06-25 10:31:22 +00:00

68 lines
1.2 KiB
CUE

package main
import (
"alpha.dagger.io/dagger"
"alpha.dagger.io/os"
"alpha.dagger.io/alpine"
)
// Assert that there are no errors
err: ""
// Directory containing universe packages (./universe/ in dagger repo)
universe: dagger.#Input & dagger.#Artifact
ctr: #CueCLI & {
vendor: "alpha.dagger.io": universe
command: """
(
find . -name '*.cue' -print0 | xargs -0iX dirname X | sort -u | {
while read -r dir; do
echo "--- $dir"
cue eval "$dir" >/dev/null
done
} > /out 2>/err
) || true
"""
}
result: (os.#File & {
from: ctr.ctr
path: "/out"
}).contents @dagger(output)
err: (os.#File & {
from: ctr.ctr
path: "/err"
}).contents @dagger(output)
#CueCLI: {
command: string
vendor: [name=string]: dagger.#Artifact
ctr: os.#Container & {
image: alpine.#Image & {
package: {
curl: true
tar: true
}
}
setup: [
"""
set -e
cd $(mktemp -d)
curl -L https://github.com/cuelang/cue/releases/download/v0.4.0/cue_v0.4.0_linux_amd64.tar.gz -o cue.tgz
tar zxvf cue.tgz
cp cue /usr/local/bin/cue
rm -fr ./*
""",
]
for name, dir in vendor {
mount: "/ctx/cue.mod/pkg/\(name)": from: dir
}
dir: "/ctx"
"command": command
}
}