package main
import (
"alpha.dagger.io/aws"
"alpha.dagger.io/aws/ecr"
"alpha.dagger.io/dagger/op"
"alpha.dagger.io/random"
)
TestConfig: awsConfig: aws.#Config & {
region: "us-east-2"
}
TestECR: {
suffix: random.#String & {
seed: ""
repository: "125635003186.dkr.ecr.\(TestConfig.awsConfig.region).amazonaws.com/dagger-ci"
tag: "test-ecr-\(suffix.out)"
creds: ecr.#Credentials & {
config: TestConfig.awsConfig
push: {
ref: "\(repository):\(tag)"
#up: [
op.#DockerBuild & {
dockerfile: """
FROM alpine
RUN echo \(suffix.out) > /test
"""
},
op.#DockerLogin & {
target: repository
username: creds.username
secret: creds.secret
op.#PushContainer & {
"ref": ref
]
pull: #up: [
target: push.ref
op.#FetchContainer & {
ref: push.ref
verify: #up: [
op.#Load & {
from: pull
op.#Exec & {
always: true
args: [
"sh", "-c", "test $(cat test) = \(suffix.out)",
verifyBuild: #up: [
dockerfile: #"""
FROM \#(push.ref)
RUN test $(cat test) = \#(suffix.out)
"""#