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>
This commit is contained in:
Andrea Luzzardi
2022-01-11 12:40:02 -08:00
parent e5316f3a1e
commit 282759c0e5
277 changed files with 33 additions and 31 deletions

View File

@@ -0,0 +1,88 @@
package compose
import (
"alpha.dagger.io/dagger"
"alpha.dagger.io/docker"
"alpha.dagger.io/random"
)
repo: dagger.#Artifact @dagger(input)
TestSSH: {
key: dagger.#Secret @dagger(input)
host: string @dagger(input)
user: string @dagger(input)
}
TestCompose: {
// Generate a random string.
// Seed is used to force buildkit execution and not simply use a previous generated string.
suffix: random.#String & {seed: "cmp"}
name: "compose_test_\(suffix.out)"
up: #App & {
ssh: {
key: TestSSH.key
host: TestSSH.host
user: TestSSH.user
}
source: repo
"name": name
}
verify: docker.#Command & {
ssh: up.run.ssh
command: #"""
docker container ls | grep "\#(name)_api" | grep "Up"
"""#
}
cleanup: #CleanupCompose & {
context: up.run
"name": name
ssh: verify.ssh
}
}
TestInlineCompose: {
// Generate a random string.
// Seed is used to force buildkit execution and not simply use a previous generated string.
suffix: random.#String & {seed: "cmp-inline"}
name: "inline_test_\(suffix.out)"
up: #App & {
ssh: {
key: TestSSH.key
host: TestSSH.host
user: TestSSH.user
}
source: repo
"name": name
composeFile: #"""
version: "3"
services:
api-mix:
build: .
environment:
PORT: 7000
ports:
- 7000
"""#
}
verify: docker.#Command & {
ssh: up.run.ssh
command: #"""
docker container ls | grep "\#(name)_api-mix" | grep "Up"
"""#
}
cleanup: #CleanupCompose & {
context: up.run
"name": name
ssh: verify.ssh
}
}