stdlib: add random package
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"dagger.io/aws"
|
||||
"dagger.io/aws/ecr"
|
||||
"dagger.io/dagger/op"
|
||||
"dagger.io/random"
|
||||
)
|
||||
|
||||
TestConfig: awsConfig: aws.#Config & {
|
||||
@@ -11,10 +12,12 @@ TestConfig: awsConfig: aws.#Config & {
|
||||
}
|
||||
|
||||
TestECR: {
|
||||
random: #Random & {}
|
||||
suffix: random.#String & {
|
||||
seed: ""
|
||||
}
|
||||
|
||||
repository: "125635003186.dkr.ecr.\(TestConfig.awsConfig.region).amazonaws.com/dagger-ci"
|
||||
tag: "test-ecr-\(random.out)"
|
||||
tag: "test-ecr-\(suffix.out)"
|
||||
|
||||
creds: ecr.#Credentials & {
|
||||
config: TestConfig.awsConfig
|
||||
@@ -27,7 +30,7 @@ TestECR: {
|
||||
op.#DockerBuild & {
|
||||
dockerfile: """
|
||||
FROM alpine
|
||||
RUN echo \(random.out) > /test
|
||||
RUN echo \(suffix.out) > /test
|
||||
"""
|
||||
},
|
||||
|
||||
@@ -63,7 +66,7 @@ TestECR: {
|
||||
op.#Exec & {
|
||||
always: true
|
||||
args: [
|
||||
"sh", "-c", "test $(cat test) = \(random.out)",
|
||||
"sh", "-c", "test $(cat test) = \(suffix.out)",
|
||||
]
|
||||
},
|
||||
]
|
||||
@@ -78,7 +81,7 @@ TestECR: {
|
||||
op.#DockerBuild & {
|
||||
dockerfile: #"""
|
||||
FROM \#(push.ref)
|
||||
RUN test $(cat test) = \#(random.out)
|
||||
RUN test $(cat test) = \#(suffix.out)
|
||||
"""#
|
||||
},
|
||||
]
|
||||
|
Reference in New Issue
Block a user