Refactor random generation into a definition to make it reusable

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
Tom Chauveau
2021-06-07 23:23:16 +02:00
parent e3ee7f2568
commit fdb91a7332
20 changed files with 288 additions and 216 deletions

View File

@@ -9,8 +9,10 @@ import (
TestConfig: gcpConfig: gcp.#Config
TestGCR: {
random: #Random & {}
repository: "gcr.io/dagger-ci/test"
tag: "test-gcr-\(random)"
tag: "test-gcr-\(random.out)"
creds: gcr.#Credentials & {
config: TestConfig.gcpConfig
@@ -23,7 +25,7 @@ TestGCR: {
op.#DockerBuild & {
dockerfile: """
FROM alpine
RUN echo \(random) > /test
RUN echo \(random.out) > /test
"""
},
@@ -59,7 +61,7 @@ TestGCR: {
op.#Exec & {
always: true
args: [
"sh", "-c", "test $(cat test) = \(random)",
"sh", "-c", "test $(cat test) = \(random.out)",
]
},
]
@@ -74,7 +76,7 @@ TestGCR: {
op.#DockerBuild & {
dockerfile: #"""
FROM \#(push.ref)
RUN test $(cat test) = \#(random)
RUN test $(cat test) = \#(random.out)
"""#
},
]