Move core actions to a subpackage
Signed-off-by: Helder Correia <174525+helderco@users.noreply.github.com>
This commit is contained in:
@@ -2,18 +2,19 @@ package main
|
||||
|
||||
import (
|
||||
"dagger.io/dagger"
|
||||
"dagger.io/dagger/core"
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
actions: {
|
||||
alpineBase: dagger.#Pull & {
|
||||
alpineBase: core.#Pull & {
|
||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||
}
|
||||
busyboxBase: dagger.#Pull & {
|
||||
busyboxBase: core.#Pull & {
|
||||
source: "busybox:1.34.1@sha256:1286c6d3c393023ef93c247724a6a2d665528144ffe07bacb741cc2b4edfefad"
|
||||
}
|
||||
|
||||
exec1: dagger.#Exec & {
|
||||
exec1: core.#Exec & {
|
||||
input: alpineBase.output
|
||||
args: [
|
||||
"sh", "-c",
|
||||
@@ -23,7 +24,7 @@ dagger.#Plan & {
|
||||
]
|
||||
}
|
||||
|
||||
exec2: dagger.#Exec & {
|
||||
exec2: core.#Exec & {
|
||||
input: exec1.output
|
||||
args: [
|
||||
"sh", "-c",
|
||||
@@ -33,46 +34,46 @@ dagger.#Plan & {
|
||||
]
|
||||
}
|
||||
|
||||
removeme: dagger.#WriteFile & {
|
||||
removeme: core.#WriteFile & {
|
||||
input: dagger.#Scratch
|
||||
path: "/removeme"
|
||||
contents: "removeme"
|
||||
}
|
||||
|
||||
test: {
|
||||
diff: dagger.#Diff & {
|
||||
diff: core.#Diff & {
|
||||
lower: alpineBase.output
|
||||
upper: exec2.output
|
||||
}
|
||||
|
||||
verify_diff_foo: dagger.#ReadFile & {
|
||||
verify_diff_foo: core.#ReadFile & {
|
||||
input: diff.output
|
||||
path: "/dir/foo"
|
||||
} & {
|
||||
contents: "foo"
|
||||
}
|
||||
verify_diff_bar: dagger.#ReadFile & {
|
||||
verify_diff_bar: core.#ReadFile & {
|
||||
input: diff.output
|
||||
path: "/dir/bar"
|
||||
} & {
|
||||
contents: "bar"
|
||||
}
|
||||
|
||||
mergediff: dagger.#Merge & {
|
||||
mergediff: core.#Merge & {
|
||||
inputs: [
|
||||
busyboxBase.output,
|
||||
removeme.output,
|
||||
diff.output,
|
||||
]
|
||||
}
|
||||
verify_remove: dagger.#Exec & {
|
||||
verify_remove: core.#Exec & {
|
||||
input: mergediff.output
|
||||
args: ["test", "!", "-e", "/removeme"]
|
||||
}
|
||||
verify_no_alpine_base: dagger.#Exec & {
|
||||
verify_no_alpine_base: core.#Exec & {
|
||||
input: mergediff.output
|
||||
// make sure the the Diff actually separated files from the base
|
||||
// by testing the non-existence of a file that only exists in the
|
||||
// by testing the non-existence of a file that only exists in the
|
||||
// alpine base, not busybox
|
||||
args: ["test", "!", "-e", "/etc/alpine-release"]
|
||||
}
|
||||
|
Reference in New Issue
Block a user