rename engine.#Build to engine.#Dockerfile
Signed-off-by: Richard Jones <richard@dagger.io>
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"dagger.io/dagger/engine"
|
||||
)
|
||||
|
||||
engine.#Plan & {
|
||||
inputs: directories: testdata: path: "./testdata"
|
||||
|
||||
actions: build: engine.#Build & {
|
||||
source: inputs.directories.testdata.contents
|
||||
dockerfile: contents: """
|
||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||
ARG TEST=foo
|
||||
RUN test "${TEST}" = "bar"
|
||||
"""
|
||||
buildArg: TEST: "bar"
|
||||
}
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"dagger.io/dagger/engine"
|
||||
"encoding/yaml"
|
||||
)
|
||||
|
||||
engine.#Plan & {
|
||||
inputs: {
|
||||
directories: testdata: path: "./testdata"
|
||||
secrets: sops: command: {
|
||||
name: "sops"
|
||||
args: ["-d", "../../secrets_sops.yaml"]
|
||||
}
|
||||
}
|
||||
|
||||
actions: {
|
||||
dockerHubToken: engine.#TransformSecret & {
|
||||
input: inputs.secrets.sops.contents
|
||||
#function: {
|
||||
input: _
|
||||
output: yaml.Unmarshal(input)
|
||||
}
|
||||
}
|
||||
|
||||
build: engine.#Build & {
|
||||
source: inputs.directories.testdata.contents
|
||||
auth: [{
|
||||
target: "daggerio/ci-test:private-pull"
|
||||
username: "daggertest"
|
||||
|
||||
secret: dockerHubToken.output.DOCKERHUB_TOKEN.contents
|
||||
}]
|
||||
dockerfile: contents: """
|
||||
FROM daggerio/ci-test:private-pull@sha256:c74f1b1166784193ea6c8f9440263b9be6cae07dfe35e32a5df7a31358ac2060
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
@@ -1 +0,0 @@
|
||||
module: ""
|
3
tests/tasks/build/cue.mod/pkg/.gitignore
vendored
3
tests/tasks/build/cue.mod/pkg/.gitignore
vendored
@@ -1,3 +0,0 @@
|
||||
# generated by dagger
|
||||
alpha.dagger.io
|
||||
dagger.lock
|
@@ -1,20 +0,0 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"dagger.io/dagger/engine"
|
||||
)
|
||||
|
||||
engine.#Plan & {
|
||||
inputs: directories: testdata: path: "./testdata"
|
||||
|
||||
actions: {
|
||||
build: engine.#Build & {
|
||||
source: inputs.directories.testdata.contents
|
||||
}
|
||||
|
||||
verify: engine.#Exec & {
|
||||
input: build.output
|
||||
args: ["sh", "-c", "test $(cat /dir/foo) = foobar"]
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,21 +0,0 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"dagger.io/dagger/engine"
|
||||
)
|
||||
|
||||
engine.#Plan & {
|
||||
inputs: directories: testdata: path: "./testdata"
|
||||
|
||||
actions: {
|
||||
build: engine.#Build & {
|
||||
source: inputs.directories.testdata.contents
|
||||
dockerfile: path: "./dockerfilepath/Dockerfile.custom"
|
||||
}
|
||||
|
||||
verify: engine.#Exec & {
|
||||
input: build.output
|
||||
args: ["sh", "-c", "test $(cat /test) = dockerfilePath"]
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,26 +0,0 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"dagger.io/dagger/engine"
|
||||
)
|
||||
|
||||
engine.#Plan & {
|
||||
inputs: directories: testdata: path: "./testdata"
|
||||
|
||||
actions: {
|
||||
// FIXME: this doesn't test anything beside not crashing
|
||||
build: engine.#Build & {
|
||||
source: inputs.directories.testdata.contents
|
||||
dockerfile: contents: """
|
||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||
ENV test foobar
|
||||
CMD /test-cmd
|
||||
"""
|
||||
} & {
|
||||
config: {
|
||||
Env: ["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "test=foobar"]
|
||||
Cmd: ["/bin/sh", "-c", "/test-cmd"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,94 +0,0 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"dagger.io/dagger/engine"
|
||||
)
|
||||
|
||||
engine.#Plan & {
|
||||
inputs: directories: testdata: path: "./testdata"
|
||||
|
||||
actions: {
|
||||
build: engine.#Build & {
|
||||
source: inputs.directories.testdata.contents
|
||||
dockerfile: contents: """
|
||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||
RUN echo foobar > /output
|
||||
"""
|
||||
}
|
||||
|
||||
verify: engine.#Exec & {
|
||||
input: build.output
|
||||
args: ["sh", "-c", "test $(cat /output) = foobar"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TestDockerfilePath: #up: [
|
||||
// op.#DockerBuild & {
|
||||
// context: TestData
|
||||
// dockerfilePath: "./dockerfilepath/Dockerfile.custom"
|
||||
// },
|
||||
// op.#Exec & {
|
||||
// args: ["sh", "-c", "test $(cat /test) = dockerfilePath"]
|
||||
// },
|
||||
// ]
|
||||
|
||||
// TestBuildArgs: #up: [
|
||||
// op.#DockerBuild & {
|
||||
// dockerfile: """
|
||||
// FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||
// ARG TEST=foo
|
||||
// RUN test "${TEST}" = "bar"
|
||||
// """
|
||||
// buildArg: TEST: "bar"
|
||||
// },
|
||||
// ]
|
||||
|
||||
// // FIXME: this doesn't test anything beside not crashing
|
||||
// TestBuildLabels: #up: [
|
||||
// op.#DockerBuild & {
|
||||
// dockerfile: """
|
||||
// FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||
// """
|
||||
// label: FOO: "bar"
|
||||
// },
|
||||
// ]
|
||||
|
||||
// // FIXME: this doesn't test anything beside not crashing
|
||||
// TestBuildPlatform: #up: [
|
||||
// op.#DockerBuild & {
|
||||
// dockerfile: """
|
||||
// FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||
// """
|
||||
// platforms: ["linux/amd64"]
|
||||
// },
|
||||
// ]
|
||||
|
||||
// TestImageMetadata: #up: [
|
||||
// op.#DockerBuild & {
|
||||
// dockerfile: """
|
||||
// FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||
// ENV CHECK foobar
|
||||
// ENV DOUBLECHECK test
|
||||
// """
|
||||
// },
|
||||
// op.#Exec & {
|
||||
// args: ["sh", "-c", #"""
|
||||
// env
|
||||
// test "$CHECK" = "foobar"
|
||||
// """#]
|
||||
// },
|
||||
// ]
|
||||
|
||||
// // Make sure the metadata is carried over with a `Load`
|
||||
// TestImageMetadataIndirect: #up: [
|
||||
// op.#Load & {
|
||||
// from: TestImageMetadata
|
||||
// },
|
||||
// op.#Exec & {
|
||||
// args: ["sh", "-c", #"""
|
||||
// env
|
||||
// test "$DOUBLECHECK" = "test"
|
||||
// """#]
|
||||
// },
|
||||
// ]
|
@@ -1,20 +0,0 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"dagger.io/dagger/engine"
|
||||
)
|
||||
|
||||
engine.#Plan & {
|
||||
inputs: directories: testdata: path: "./testdata"
|
||||
|
||||
actions: {
|
||||
// FIXME: this doesn't test anything beside not crashing
|
||||
build: engine.#Build & {
|
||||
source: inputs.directories.testdata.contents
|
||||
dockerfile: contents: """
|
||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||
"""
|
||||
label: FOO: "bar"
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,20 +0,0 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"dagger.io/dagger/engine"
|
||||
)
|
||||
|
||||
engine.#Plan & {
|
||||
inputs: directories: testdata: path: "./testdata"
|
||||
|
||||
actions: {
|
||||
// FIXME: this doesn't test anything beside not crashing
|
||||
build: engine.#Build & {
|
||||
source: inputs.directories.testdata.contents
|
||||
dockerfile: contents: """
|
||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||
"""
|
||||
platforms: ["linux/amd64"]
|
||||
}
|
||||
}
|
||||
}
|
3
tests/tasks/build/testdata/Dockerfile
vendored
3
tests/tasks/build/testdata/Dockerfile
vendored
@@ -1,3 +0,0 @@
|
||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||
COPY . /dir
|
||||
RUN test $(cat /dir/foo) = foobar
|
@@ -1,2 +0,0 @@
|
||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||
RUN echo dockerfilePath > /test
|
1
tests/tasks/build/testdata/foo
vendored
1
tests/tasks/build/testdata/foo
vendored
@@ -1 +0,0 @@
|
||||
foobar
|
Reference in New Issue
Block a user