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/docker/tests/push-multi-registry/push.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

66 lines
1.3 KiB
CUE

package docker
import (
"alpha.dagger.io/aws"
"alpha.dagger.io/aws/ecr"
"alpha.dagger.io/dagger"
"alpha.dagger.io/random"
)
//
// /!\ README /!\
// The objective is to push an image on multiple registries to verify
// that we correctly handle that kind of configuration
//
TestResources: {
// Generate a random string
// Seed is used to force buildkit execution and not simply use a previous generated string.
suffix: random.#String & {seed: "docker multi registry"}
image: #Build & {
dockerfile: """
FROM alpine
RUN echo "test" > /test.txt
"""
source: ""
}
}
TestRemoteAWS: {
awsConfig: aws.#Config
ecrCreds: ecr.#Credentials & {
config: awsConfig
}
target: "125635003186.dkr.ecr.\(awsConfig.region).amazonaws.com/dagger-ci:test-ecr-\(TestResources.suffix.out)"
remoteImg: #Push & {
"target": target
source: TestResources.image
auth: {
username: ecrCreds.username
secret: ecrCreds.secret
}
}
}
TestRemoteDocker: {
dockerConfig: {
username: dagger.#Input & {string}
secret: dagger.#Input & {dagger.#Secret}
}
target: "daggerio/ci-test:test-docker-\(TestResources.suffix.out)"
remoteImg: #Push & {
"target": target
source: TestResources.image
auth: {
username: dockerConfig.username
secret: dockerConfig.secret
}
}
}