rename engine.#Build to engine.#Dockerfile
Signed-off-by: Richard Jones <richard@dagger.io>
This commit is contained in:
parent
ecc45543a0
commit
729013ae91
@ -69,9 +69,8 @@ package engine
|
||||
}
|
||||
|
||||
// Build a container image using buildkit
|
||||
// FIXME: rename to #Dockerfile to clarify scope
|
||||
#Build: {
|
||||
$dagger: task: _name: "Build"
|
||||
#Dockerfile: {
|
||||
$dagger: task: _name: "Dockerfile"
|
||||
|
||||
// Source directory to build
|
||||
source: #FS
|
||||
|
@ -22,13 +22,13 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
Register("Build", func() Task { return &buildTask{} })
|
||||
Register("Dockerfile", func() Task { return &dockerfileTask{} })
|
||||
}
|
||||
|
||||
type buildTask struct {
|
||||
type dockerfileTask struct {
|
||||
}
|
||||
|
||||
func (t *buildTask) Run(ctx context.Context, pctx *plancontext.Context, s solver.Solver, v *compiler.Value) (*compiler.Value, error) {
|
||||
func (t *dockerfileTask) Run(ctx context.Context, pctx *plancontext.Context, s solver.Solver, v *compiler.Value) (*compiler.Value, error) {
|
||||
frontend, err := v.Lookup("frontend").String()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -42,7 +42,7 @@ func (t *buildTask) Run(ctx context.Context, pctx *plancontext.Context, s solver
|
||||
}
|
||||
}
|
||||
|
||||
func (t *buildTask) dockerfile(ctx context.Context, pctx *plancontext.Context, s solver.Solver, v *compiler.Value) (*compiler.Value, error) {
|
||||
func (t *dockerfileTask) dockerfile(ctx context.Context, pctx *plancontext.Context, s solver.Solver, v *compiler.Value) (*compiler.Value, error) {
|
||||
lg := log.Ctx(ctx)
|
||||
|
||||
// Read auth info
|
||||
@ -144,7 +144,7 @@ func (t *buildTask) dockerfile(ctx context.Context, pctx *plancontext.Context, s
|
||||
})
|
||||
}
|
||||
|
||||
func (t *buildTask) 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{}
|
||||
|
||||
if dockerfilePath := v.Lookup("dockerfile.path"); dockerfilePath.Exists() {
|
@ -75,8 +75,8 @@ setup() {
|
||||
assert_failure
|
||||
}
|
||||
|
||||
@test "task: #Build" {
|
||||
cd "$TESTDIR"/tasks/build
|
||||
@test "task: #Dockerfile" {
|
||||
cd "$TESTDIR"/tasks/dockerfile
|
||||
|
||||
"$DAGGER" --europa up ./dockerfile.cue
|
||||
"$DAGGER" --europa up ./inlined_dockerfile.cue
|
||||
@ -87,7 +87,7 @@ setup() {
|
||||
"$DAGGER" --europa up ./platform.cue
|
||||
|
||||
cd "$TESTDIR"
|
||||
"$DAGGER" --europa up ./tasks/build/build_auth.cue
|
||||
"$DAGGER" --europa up ./tasks/dockerfile/build_auth.cue
|
||||
}
|
||||
@test "task: #Scratch" {
|
||||
cd "$TESTDIR"/tasks/scratch
|
||||
|
1
tests/tasks/copy/cue.mod/pkg/.gitignore
vendored
1
tests/tasks/copy/cue.mod/pkg/.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
# generated by dagger
|
||||
alpha.dagger.io
|
||||
dagger.io
|
||||
dagger.lock
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
engine.#Plan & {
|
||||
inputs: directories: testdata: path: "./testdata"
|
||||
|
||||
actions: build: engine.#Build & {
|
||||
actions: build: engine.#Dockerfile & {
|
||||
source: inputs.directories.testdata.contents
|
||||
dockerfile: contents: """
|
||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
@ -8,7 +8,7 @@ engine.#Plan & {
|
||||
inputs: directories: testdata: path: "./testdata"
|
||||
|
||||
actions: {
|
||||
build: engine.#Build & {
|
||||
build: engine.#Dockerfile & {
|
||||
source: inputs.directories.testdata.contents
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ engine.#Plan & {
|
||||
inputs: directories: testdata: path: "./testdata"
|
||||
|
||||
actions: {
|
||||
build: engine.#Build & {
|
||||
build: engine.#Dockerfile & {
|
||||
source: inputs.directories.testdata.contents
|
||||
dockerfile: path: "./dockerfilepath/Dockerfile.custom"
|
||||
}
|
@ -9,7 +9,7 @@ engine.#Plan & {
|
||||
|
||||
actions: {
|
||||
// FIXME: this doesn't test anything beside not crashing
|
||||
build: engine.#Build & {
|
||||
build: engine.#Dockerfile & {
|
||||
source: inputs.directories.testdata.contents
|
||||
dockerfile: contents: """
|
||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
@ -8,7 +8,7 @@ engine.#Plan & {
|
||||
inputs: directories: testdata: path: "./testdata"
|
||||
|
||||
actions: {
|
||||
build: engine.#Build & {
|
||||
build: engine.#Dockerfile & {
|
||||
source: inputs.directories.testdata.contents
|
||||
dockerfile: contents: """
|
||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
@ -9,7 +9,7 @@ engine.#Plan & {
|
||||
|
||||
actions: {
|
||||
// FIXME: this doesn't test anything beside not crashing
|
||||
build: engine.#Build & {
|
||||
build: engine.#Dockerfile & {
|
||||
source: inputs.directories.testdata.contents
|
||||
dockerfile: contents: """
|
||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
@ -9,7 +9,7 @@ engine.#Plan & {
|
||||
|
||||
actions: {
|
||||
// FIXME: this doesn't test anything beside not crashing
|
||||
build: engine.#Build & {
|
||||
build: engine.#Dockerfile & {
|
||||
source: inputs.directories.testdata.contents
|
||||
dockerfile: contents: """
|
||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
1
tests/tasks/exec/cue.mod/pkg/.gitignore
vendored
1
tests/tasks/exec/cue.mod/pkg/.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
# generated by dagger
|
||||
alpha.dagger.io
|
||||
dagger.io
|
||||
dagger.lock
|
||||
|
1
tests/tasks/mkdir/cue.mod/pkg/.gitignore
vendored
1
tests/tasks/mkdir/cue.mod/pkg/.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
# generated by dagger
|
||||
alpha.dagger.io
|
||||
dagger.io
|
||||
dagger.lock
|
||||
|
1
tests/tasks/pull/cue.mod/pkg/.gitignore
vendored
1
tests/tasks/pull/cue.mod/pkg/.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
# generated by dagger
|
||||
alpha.dagger.io
|
||||
dagger.io
|
||||
dagger.lock
|
||||
|
1
tests/tasks/readfile/cue.mod/pkg/.gitignore
vendored
1
tests/tasks/readfile/cue.mod/pkg/.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
# generated by dagger
|
||||
alpha.dagger.io
|
||||
dagger.io
|
||||
dagger.lock
|
||||
|
1
tests/tasks/scratch/cue.mod/pkg/.gitignore
vendored
1
tests/tasks/scratch/cue.mod/pkg/.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
# generated by dagger
|
||||
alpha.dagger.io
|
||||
dagger.io
|
||||
dagger.lock
|
||||
|
1
tests/tasks/writefile/cue.mod/pkg/.gitignore
vendored
1
tests/tasks/writefile/cue.mod/pkg/.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
# generated by dagger
|
||||
alpha.dagger.io
|
||||
dagger.io
|
||||
dagger.lock
|
||||
|
Reference in New Issue
Block a user