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/tests/llb/push-container/main.cue
Solomon Hykes 6673ae69b3 stdlib: rename dagger.io/llb to dagger.io/dagger/op
Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
2021-04-06 10:28:40 -07:00

57 lines
851 B
CUE

package main
import (
"dagger.io/dagger/op"
"dagger.io/alpine"
)
TestPushContainer: {
// Generate a random number
random: {
string
#up: [
op.#Load & {from: alpine.#Image},
op.#Exec & {
args: ["sh", "-c", "echo -n $RANDOM > /rand"]
},
op.#Export & {
source: "/rand"
},
]
}
// Push an image with a random tag
push: {
ref: "daggerio/ci-test:\(random)"
#up: [
op.#WriteFile & {
content: random
dest: "/rand"
},
op.#PushContainer & {
"ref": ref
},
]
}
// Pull the image back
pull: #up: [
op.#FetchContainer & {
ref: push.ref
},
]
// Check the content
check: #up: [
op.#Load & {from: alpine.#Image},
op.#Exec & {
args: [
"sh", "-c", #"""
test "$(cat /src/rand)" = "\#(random)"
"""#,
]
mount: "/src": from: pull
},
]
}