added dockerfile: field back to force evaluation of disjunction

Signed-off-by: Richard Jones <richard@dagger.io>
This commit is contained in:
Richard Jones 2022-01-13 11:57:47 -07:00
parent 2745e1ae2e
commit e59ba48ec0
No known key found for this signature in database
GPG Key ID: CFB3A382EB166F4C
9 changed files with 10 additions and 9 deletions

View File

@ -75,7 +75,7 @@ package engine
// Source directory to build // Source directory to build
source: #FS source: #FS
*{ dockerfile: *{
path: string | *"Dockerfile" path: string | *"Dockerfile"
} | { } | {
contents: string contents: string

View File

@ -60,7 +60,7 @@ func (t *dockerfileTask) Run(ctx context.Context, pctx *plancontext.Context, s s
dockerfileDef := contextDef dockerfileDef := contextDef
// Support inlined dockerfile // Support inlined dockerfile
if dockerfile := v.Lookup("contents"); dockerfile.Exists() { if dockerfile := v.Lookup("dockerfile.contents"); dockerfile.Exists() {
contents, err := dockerfile.String() contents, err := dockerfile.String()
if err != nil { if err != nil {
return nil, err return nil, err
@ -133,7 +133,7 @@ func (t *dockerfileTask) Run(ctx context.Context, pctx *plancontext.Context, s s
func (t *dockerfileTask) dockerBuildOpts(v *compiler.Value, pctx *plancontext.Context) (map[string]string, error) { func (t *dockerfileTask) dockerBuildOpts(v *compiler.Value, pctx *plancontext.Context) (map[string]string, error) {
opts := map[string]string{} opts := map[string]string{}
if dockerfilePath := v.Lookup("path"); dockerfilePath.Exists() { if dockerfilePath := v.Lookup("dockerfile.path"); dockerfilePath.Exists() {
filename, err := dockerfilePath.String() filename, err := dockerfilePath.String()
if err != nil { if err != nil {
return nil, err return nil, err

View File

@ -9,7 +9,7 @@ engine.#Plan & {
actions: build: engine.#Dockerfile & { actions: build: engine.#Dockerfile & {
source: inputs.directories.testdata.contents source: inputs.directories.testdata.contents
contents: """ dockerfile: contents: """
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
ARG TEST=foo ARG TEST=foo
RUN test "${TEST}" = "bar" RUN test "${TEST}" = "bar"

View File

@ -10,6 +10,7 @@ engine.#Plan & {
actions: { actions: {
build: engine.#Dockerfile & { build: engine.#Dockerfile & {
source: inputs.directories.testdata.contents source: inputs.directories.testdata.contents
// path: "Dockerfile"
} }
verify: engine.#Exec & { verify: engine.#Exec & {

View File

@ -10,7 +10,7 @@ engine.#Plan & {
actions: { actions: {
build: engine.#Dockerfile & { build: engine.#Dockerfile & {
source: inputs.directories.testdata.contents source: inputs.directories.testdata.contents
path: "./dockerfilepath/Dockerfile.custom" dockerfile: path: "./dockerfilepath/Dockerfile.custom"
} }
verify: engine.#Exec & { verify: engine.#Exec & {

View File

@ -11,7 +11,7 @@ engine.#Plan & {
// FIXME: this doesn't test anything beside not crashing // FIXME: this doesn't test anything beside not crashing
build: engine.#Dockerfile & { build: engine.#Dockerfile & {
source: inputs.directories.testdata.contents source: inputs.directories.testdata.contents
contents: """ dockerfile: contents: """
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
ENV test foobar ENV test foobar
CMD /test-cmd CMD /test-cmd

View File

@ -10,7 +10,7 @@ engine.#Plan & {
actions: { actions: {
build: engine.#Dockerfile & { build: engine.#Dockerfile & {
source: inputs.directories.testdata.contents source: inputs.directories.testdata.contents
contents: """ dockerfile: contents: """
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
RUN echo foobar > /output RUN echo foobar > /output
""" """

View File

@ -11,7 +11,7 @@ engine.#Plan & {
// FIXME: this doesn't test anything beside not crashing // FIXME: this doesn't test anything beside not crashing
build: engine.#Dockerfile & { build: engine.#Dockerfile & {
source: inputs.directories.testdata.contents source: inputs.directories.testdata.contents
contents: """ dockerfile: contents: """
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
""" """
label: FOO: "bar" label: FOO: "bar"

View File

@ -11,7 +11,7 @@ engine.#Plan & {
// FIXME: this doesn't test anything beside not crashing // FIXME: this doesn't test anything beside not crashing
build: engine.#Dockerfile & { build: engine.#Dockerfile & {
source: inputs.directories.testdata.contents source: inputs.directories.testdata.contents
contents: """ dockerfile: contents: """
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
""" """
platforms: ["linux/amd64"] platforms: ["linux/amd64"]