diff --git a/Makefile b/Makefile index f88b247e..be62d8e1 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ test: .PHONY: cuefmt cuefmt: - @(cd ./dagger && cue fmt -s ./... && cue trim -s ./...) + @(cue fmt -s ./... && cue trim -s ./...) .PHONY: lint lint: generate cuefmt diff --git a/examples/tests/compute/invalid/bool/main.cue b/examples/tests/compute/invalid/bool/main.cue index 4aaf21ef..54990a89 100644 --- a/examples/tests/compute/invalid/bool/main.cue +++ b/examples/tests/compute/invalid/bool/main.cue @@ -1,5 +1,3 @@ package testing -#dagger: { - compute: true -} +#dagger: compute: true diff --git a/examples/tests/compute/invalid/int/main.cue b/examples/tests/compute/invalid/int/main.cue index 9163163b..d9f885ad 100644 --- a/examples/tests/compute/invalid/int/main.cue +++ b/examples/tests/compute/invalid/int/main.cue @@ -1,5 +1,3 @@ package testing -#dagger: { - compute: 123 -} +#dagger: compute: 123 diff --git a/examples/tests/compute/invalid/string/main.cue b/examples/tests/compute/invalid/string/main.cue index e29446c3..5da733ed 100644 --- a/examples/tests/compute/invalid/string/main.cue +++ b/examples/tests/compute/invalid/string/main.cue @@ -1,5 +1,3 @@ package testing -#dagger: { - compute: "whatever" -} +#dagger: compute: "whatever" diff --git a/examples/tests/compute/invalid/struct/main.cue b/examples/tests/compute/invalid/struct/main.cue index 1c77f587..a1cb94f5 100644 --- a/examples/tests/compute/invalid/struct/main.cue +++ b/examples/tests/compute/invalid/struct/main.cue @@ -1,7 +1,3 @@ package testing -#dagger: { - compute: { - whatever: "wrong" - } -} +#dagger: compute: whatever: "wrong" diff --git a/examples/tests/compute/simple/main.cue b/examples/tests/compute/simple/main.cue index 2cf7afeb..9c6fca88 100644 --- a/examples/tests/compute/simple/main.cue +++ b/examples/tests/compute/simple/main.cue @@ -1,15 +1,13 @@ package testing -#dagger: { - compute: [ - { - do: "fetch-container" - ref: "alpine" - }, - { - do: "exec" - args: ["true"] - dir: "/" - } - ] -} +#dagger: compute: [ + { + do: "fetch-container" + ref: "alpine" + }, + { + do: "exec" + args: ["true"] + dir: "/" + }, +] diff --git a/examples/tests/compute/undefined_prop/main.cue b/examples/tests/compute/undefined_prop/main.cue index 1dfd8cb6..10d1b06c 100644 --- a/examples/tests/compute/undefined_prop/main.cue +++ b/examples/tests/compute/undefined_prop/main.cue @@ -7,14 +7,14 @@ bar: string #dagger: { compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { - do: "exec" + do: "exec" dir: "/" args: ["sh", "-c", "echo \(foo.bar)"] - } + }, ] foo: bar: bar } diff --git a/examples/tests/copy/invalid/cache/main.cue b/examples/tests/copy/invalid/cache/main.cue index f9699c12..642581c5 100644 --- a/examples/tests/copy/invalid/cache/main.cue +++ b/examples/tests/copy/invalid/cache/main.cue @@ -3,47 +3,43 @@ package testing test1: { string - #dagger: { - compute: [ - { - do: "fetch-container" - ref: "busybox" - }, - { - do: "copy" - from: [{do: "fetch-container", ref: "alpine"}] - src: "/etc/issue" - dest: "/" - }, - { - do: "export" - source: "/issue" - format: "string" - }, - ] - } + #dagger: compute: [ + { + do: "fetch-container" + ref: "busybox" + }, + { + do: "copy" + from: [{do: "fetch-container", ref: "alpine"}] + src: "/etc/issue" + dest: "/" + }, + { + do: "export" + source: "/issue" + format: "string" + }, + ] } test2: { string - #dagger: { - compute: [ - { - do: "fetch-container" - ref: "busybox" - }, - { - do: "copy" - from: [{do: "fetch-container", ref: "busybox"}] - src: "/etc/issue" - dest: "/" - }, - { - do: "export" - source: "/issue" - format: "string" - }, - ] - } + #dagger: compute: [ + { + do: "fetch-container" + ref: "busybox" + }, + { + do: "copy" + from: [{do: "fetch-container", ref: "busybox"}] + src: "/etc/issue" + dest: "/" + }, + { + do: "export" + source: "/issue" + format: "string" + }, + ] } diff --git a/examples/tests/copy/valid/component/main.cue b/examples/tests/copy/valid/component/main.cue index 0ba7d1a4..ddcd9287 100644 --- a/examples/tests/copy/valid/component/main.cue +++ b/examples/tests/copy/valid/component/main.cue @@ -1,69 +1,65 @@ package testing component: #dagger: compute: [{ - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { do: "exec" args: ["sh", "-c", """ - printf lol > /id - """] + printf lol > /id + """] dir: "/" }] test1: { string - #dagger: { - compute: [ - { - do: "fetch-container" - ref: "busybox" - }, - { - do: "copy" - from: component - src: "/id" - dest: "/" - }, - { - do: "export" - source: "/id" - format: "string" - }, - ] - } + #dagger: compute: [ + { + do: "fetch-container" + ref: "busybox" + }, + { + do: "copy" + from: component + src: "/id" + dest: "/" + }, + { + do: "export" + source: "/id" + format: "string" + }, + ] } test2: { string - #dagger: { - compute: [ - { - do: "fetch-container" - ref: "busybox" - }, - { - do: "copy" - from: #dagger: compute: [{ - do: "fetch-container" - ref: "alpine" - }, { - do: "exec" - args: ["sh", "-c", """ + #dagger: compute: [ + { + do: "fetch-container" + ref: "busybox" + }, + { + do: "copy" + from: #dagger: compute: [{ + do: "fetch-container" + ref: "alpine" + }, { + do: "exec" + args: ["sh", "-c", """ printf lol > /id """] - dir: "/" - }] - src: "/id" - dest: "/" - }, - { - do: "export" - source: "/id" - format: "string" - }, - ] - } + dir: "/" + }] + src: "/id" + dest: "/" + }, + { + do: "export" + source: "/id" + format: "string" + }, + ] } diff --git a/examples/tests/copy/valid/script/main.cue b/examples/tests/copy/valid/script/main.cue index a0a5410f..c78aac25 100644 --- a/examples/tests/copy/valid/script/main.cue +++ b/examples/tests/copy/valid/script/main.cue @@ -3,23 +3,21 @@ package testing test: { string - #dagger: { - compute: [ - { - do: "fetch-container" - ref: "busybox" - }, - { - do: "copy" - from: [{do: "fetch-container", ref: "alpine"}] - src: "/etc/issue" - dest: "/" - }, - { - do: "export" - source: "/issue" - format: "string" - }, - ] - } + #dagger: compute: [ + { + do: "fetch-container" + ref: "busybox" + }, + { + do: "copy" + from: [{do: "fetch-container", ref: "alpine"}] + src: "/etc/issue" + dest: "/" + }, + { + do: "export" + source: "/issue" + format: "string" + }, + ] } diff --git a/examples/tests/exec/always/main.cue b/examples/tests/exec/always/main.cue index 941ebaa2..178fc085 100644 --- a/examples/tests/exec/always/main.cue +++ b/examples/tests/exec/always/main.cue @@ -2,14 +2,14 @@ package testing #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { do: "exec" args: ["echo", "always output"] // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 - dir: "/" + dir: "/" always: true }, ] diff --git a/examples/tests/exec/dir/doesnotexist/main.cue b/examples/tests/exec/dir/doesnotexist/main.cue index b23941ca..d59baa8f 100644 --- a/examples/tests/exec/dir/doesnotexist/main.cue +++ b/examples/tests/exec/dir/doesnotexist/main.cue @@ -2,7 +2,7 @@ package testing #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { diff --git a/examples/tests/exec/dir/exist/main.cue b/examples/tests/exec/dir/exist/main.cue index 243c94e6..d25b8109 100644 --- a/examples/tests/exec/dir/exist/main.cue +++ b/examples/tests/exec/dir/exist/main.cue @@ -2,15 +2,15 @@ package testing #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { do: "exec" args: ["sh", "-c", """ - echo "pwd is: $(pwd)" - [ "$(pwd)" == "/etc" ] || exit 1 - """] + echo "pwd is: $(pwd)" + [ "$(pwd)" == "/etc" ] || exit 1 + """] dir: "/etc" }, ] diff --git a/examples/tests/exec/env/invalid/main.cue b/examples/tests/exec/env/invalid/main.cue index 5989e102..cf871953 100644 --- a/examples/tests/exec/env/invalid/main.cue +++ b/examples/tests/exec/env/invalid/main.cue @@ -2,15 +2,15 @@ package testing #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { do: "exec" args: ["sh", "-c", #""" - echo "$foo" - """#] - env: foo: {lala: "lala"} + echo "$foo" + """#] + env: foo: lala: "lala" // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 dir: "/" }, diff --git a/examples/tests/exec/env/overlay/main.cue b/examples/tests/exec/env/overlay/main.cue index 263a628a..ab8323fa 100644 --- a/examples/tests/exec/env/overlay/main.cue +++ b/examples/tests/exec/env/overlay/main.cue @@ -4,15 +4,15 @@ bar: string #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { do: "exec" args: ["sh", "-c", """ - echo "foo: $foo" - [ "$foo" == "overlay environment" ] || exit 1 - """] + echo "foo: $foo" + [ "$foo" == "overlay environment" ] || exit 1 + """] env: foo: bar // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 dir: "/" diff --git a/examples/tests/exec/env/valid/main.cue b/examples/tests/exec/env/valid/main.cue index 02fee1c4..c1831efe 100644 --- a/examples/tests/exec/env/valid/main.cue +++ b/examples/tests/exec/env/valid/main.cue @@ -2,14 +2,14 @@ package testing #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { do: "exec" args: ["sh", "-c", """ - [ "$foo" == "output environment" ] || exit 1 - """] + [ "$foo" == "output environment" ] || exit 1 + """] env: foo: "output environment" // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 dir: "/" diff --git a/examples/tests/exec/error/main.cue b/examples/tests/exec/error/main.cue index 0e374910..b40304ff 100644 --- a/examples/tests/exec/error/main.cue +++ b/examples/tests/exec/error/main.cue @@ -2,7 +2,7 @@ package testing #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { diff --git a/examples/tests/exec/invalid/main.cue b/examples/tests/exec/invalid/main.cue index bbff2bbb..21d1d7f7 100644 --- a/examples/tests/exec/invalid/main.cue +++ b/examples/tests/exec/invalid/main.cue @@ -2,7 +2,7 @@ package testing #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { @@ -10,4 +10,4 @@ package testing // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 dir: "/" }, -} +] diff --git a/examples/tests/exec/simple/main.cue b/examples/tests/exec/simple/main.cue index 666d4e1c..3e500be2 100644 --- a/examples/tests/exec/simple/main.cue +++ b/examples/tests/exec/simple/main.cue @@ -2,7 +2,7 @@ package testing #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { diff --git a/examples/tests/export/bool/main.cue b/examples/tests/export/bool/main.cue index 6145ed22..27de7231 100644 --- a/examples/tests/export/bool/main.cue +++ b/examples/tests/export/bool/main.cue @@ -3,27 +3,24 @@ package testing test: { bool - #dagger: { - compute: [ - { - do: "fetch-container" - ref: "alpine" - }, - { - do: "exec" - args: ["sh", "-c", """ + #dagger: compute: [ + { + do: "fetch-container" + ref: "alpine" + }, + { + do: "exec" + args: ["sh", "-c", """ printf "true" > /tmp/out - """ - ] - dir: "/" - }, - { - do: "export" - // Source path in the container - source: "/tmp/out" - format: "bool" - }, - ] - } + """, + ] + dir: "/" + }, + { + do: "export" + // Source path in the container + source: "/tmp/out" + format: "bool" + }, + ] } - diff --git a/examples/tests/export/concurrency/main.cue b/examples/tests/export/concurrency/main.cue index 893a725f..a9e7c916 100644 --- a/examples/tests/export/concurrency/main.cue +++ b/examples/tests/export/concurrency/main.cue @@ -5,19 +5,19 @@ test1: { #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { do: "exec" args: ["sh", "-c", """ - echo lol1 > /tmp/out - """] - dir: "/" + echo lol1 > /tmp/out + """] + dir: "/" always: true }, { - do: "export" + do: "export" source: "/tmp/out" format: "string" }, @@ -29,19 +29,19 @@ test2: { #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { do: "exec" args: ["sh", "-c", """ - echo lol2 > /tmp/out - """] - dir: "/" + echo lol2 > /tmp/out + """] + dir: "/" always: true }, { - do: "export" + do: "export" source: "/tmp/out" format: "string" }, @@ -53,19 +53,19 @@ test3: { #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { do: "exec" args: ["sh", "-c", """ - echo lol3 > /tmp/out - """] - dir: "/" + echo lol3 > /tmp/out + """] + dir: "/" always: true }, { - do: "export" + do: "export" source: "/tmp/out" format: "string" }, @@ -77,19 +77,19 @@ test4: { #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { do: "exec" args: ["sh", "-c", """ - echo lol4 > /tmp/out - """] - dir: "/" + echo lol4 > /tmp/out + """] + dir: "/" always: true }, { - do: "export" + do: "export" source: "/tmp/out" format: "string" }, @@ -101,19 +101,19 @@ test5: { #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { do: "exec" args: ["sh", "-c", """ - echo lol5 > /tmp/out - """] - dir: "/" + echo lol5 > /tmp/out + """] + dir: "/" always: true }, { - do: "export" + do: "export" source: "/tmp/out" format: "string" }, @@ -125,19 +125,19 @@ test6: { #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { do: "exec" args: ["sh", "-c", """ - echo lol6 > /tmp/out - """] - dir: "/" + echo lol6 > /tmp/out + """] + dir: "/" always: true }, { - do: "export" + do: "export" source: "/tmp/out" format: "string" }, @@ -149,19 +149,19 @@ test7: { #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { do: "exec" args: ["sh", "-c", """ - echo lol7 > /tmp/out - """] - dir: "/" + echo lol7 > /tmp/out + """] + dir: "/" always: true }, { - do: "export" + do: "export" source: "/tmp/out" format: "string" }, @@ -173,19 +173,19 @@ test8: { #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { do: "exec" args: ["sh", "-c", """ - echo lol8 > /tmp/out - """] - dir: "/" + echo lol8 > /tmp/out + """] + dir: "/" always: true }, { - do: "export" + do: "export" source: "/tmp/out" format: "string" }, @@ -197,19 +197,19 @@ test9: { #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { do: "exec" args: ["sh", "-c", """ - echo lol9 > /tmp/out - """] - dir: "/" + echo lol9 > /tmp/out + """] + dir: "/" always: true }, { - do: "export" + do: "export" source: "/tmp/out" format: "string" }, @@ -221,19 +221,19 @@ test10: { #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { do: "exec" args: ["sh", "-c", """ - echo lol10 > /tmp/out - """] - dir: "/" + echo lol10 > /tmp/out + """] + dir: "/" always: true }, { - do: "export" + do: "export" source: "/tmp/out" format: "string" }, diff --git a/examples/tests/export/invalid/format/main.cue b/examples/tests/export/invalid/format/main.cue index 368561cf..4d0ab389 100644 --- a/examples/tests/export/invalid/format/main.cue +++ b/examples/tests/export/invalid/format/main.cue @@ -3,27 +3,25 @@ package testing teststring: { string - #dagger: { - compute: [ - { - do: "fetch-container" - ref: "alpine" - }, - { - do: "exec" - args: ["sh", "-c", """ + #dagger: compute: [ + { + do: "fetch-container" + ref: "alpine" + }, + { + do: "exec" + args: ["sh", "-c", """ echo something > /tmp/out - """ - ] - // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 - dir: "/" - }, - { - do: "export" - // Source path in the container - source: "/tmp/out" - format: "lalalalal" - }, - ] - } + """, + ] + // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 + dir: "/" + }, + { + do: "export" + // Source path in the container + source: "/tmp/out" + format: "lalalalal" + }, + ] } diff --git a/examples/tests/export/invalid/path/main.cue b/examples/tests/export/invalid/path/main.cue index 0a742175..9a606ca8 100644 --- a/examples/tests/export/invalid/path/main.cue +++ b/examples/tests/export/invalid/path/main.cue @@ -3,18 +3,16 @@ package testing teststring: { string - #dagger: { - compute: [ - { - do: "fetch-container" - ref: "alpine" - }, - { - do: "export" - // Source path in the container - source: "/tmp/lalala" - format: "string" - }, - ] - } + #dagger: compute: [ + { + do: "fetch-container" + ref: "alpine" + }, + { + do: "export" + // Source path in the container + source: "/tmp/lalala" + format: "string" + }, + ] } diff --git a/examples/tests/export/invalid/validation/main.cue b/examples/tests/export/invalid/validation/main.cue index c0d33b3a..4dc18fc4 100644 --- a/examples/tests/export/invalid/validation/main.cue +++ b/examples/tests/export/invalid/validation/main.cue @@ -2,29 +2,27 @@ package testing test: { string - =~ "^NAAAA.+" + =~"^NAAAA.+" - #dagger: { - compute: [ - { - do: "fetch-container" - ref: "alpine" - }, - { - do: "exec" - args: ["sh", "-c", """ + #dagger: compute: [ + { + do: "fetch-container" + ref: "alpine" + }, + { + do: "exec" + args: ["sh", "-c", """ printf something > /tmp/out - """ - ] - // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 - dir: "/" - }, - { - do: "export" - // Source path in the container - source: "/tmp/out" - format: "string" - }, - ] - } + """, + ] + // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 + dir: "/" + }, + { + do: "export" + // Source path in the container + source: "/tmp/out" + format: "string" + }, + ] } diff --git a/examples/tests/export/json/main.cue b/examples/tests/export/json/main.cue index a68b024e..713b9c24 100644 --- a/examples/tests/export/json/main.cue +++ b/examples/tests/export/json/main.cue @@ -1,27 +1,22 @@ package testing -test: { - - #dagger: { - compute: [ - { - do: "fetch-container" - ref: "alpine" - }, - { - do: "exec" - args: ["sh", "-c", """ - echo '{"something": "something"}' > /tmp/out - """ - ] - dir: "/" - }, - { - do: "export" - // Source path in the container - source: "/tmp/out" - format: "json" - }, +test: #dagger: compute: [ + { + do: "fetch-container" + ref: "alpine" + }, + { + do: "exec" + args: ["sh", "-c", """ + echo '{"something": "something"}' > /tmp/out + """, ] - } -} + dir: "/" + }, + { + do: "export" + // Source path in the container + source: "/tmp/out" + format: "json" + }, +] diff --git a/examples/tests/export/number/main.cue b/examples/tests/export/number/main.cue index a6e85b88..b220ecf4 100644 --- a/examples/tests/export/number/main.cue +++ b/examples/tests/export/number/main.cue @@ -3,27 +3,25 @@ package testing test: { number - #dagger: { - compute: [ - { - do: "fetch-container" - ref: "alpine" - }, - { - do: "exec" - args: ["sh", "-c", """ + #dagger: compute: [ + { + do: "fetch-container" + ref: "alpine" + }, + { + do: "exec" + args: ["sh", "-c", """ echo -123.5 > /tmp/out - """ - ] - // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 - dir: "/" - }, - { - do: "export" - // Source path in the container - source: "/tmp/out" - format: "number" - }, - ] - } + """, + ] + // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 + dir: "/" + }, + { + do: "export" + // Source path in the container + source: "/tmp/out" + format: "number" + }, + ] } diff --git a/examples/tests/export/string/main.cue b/examples/tests/export/string/main.cue index 4494a8a2..85c5b49e 100644 --- a/examples/tests/export/string/main.cue +++ b/examples/tests/export/string/main.cue @@ -3,27 +3,25 @@ package testing test: { string - #dagger: { - compute: [ - { - do: "fetch-container" - ref: "alpine" - }, - { - do: "exec" - args: ["sh", "-c", """ + #dagger: compute: [ + { + do: "fetch-container" + ref: "alpine" + }, + { + do: "exec" + args: ["sh", "-c", """ printf something > /tmp/out - """ - ] - // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 - dir: "/" - }, - { - do: "export" - // Source path in the container - source: "/tmp/out" - format: "string" - }, - ] - } + """, + ] + // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 + dir: "/" + }, + { + do: "export" + // Source path in the container + source: "/tmp/out" + format: "string" + }, + ] } diff --git a/examples/tests/export/withvalidation/main.cue b/examples/tests/export/withvalidation/main.cue index 1a9ad6a0..cf62f049 100644 --- a/examples/tests/export/withvalidation/main.cue +++ b/examples/tests/export/withvalidation/main.cue @@ -2,29 +2,27 @@ package testing test: { string - =~ "^some.+" + =~"^some.+" - #dagger: { - compute: [ - { - do: "fetch-container" - ref: "alpine" - }, - { - do: "exec" - args: ["sh", "-c", """ + #dagger: compute: [ + { + do: "fetch-container" + ref: "alpine" + }, + { + do: "exec" + args: ["sh", "-c", """ printf something > /tmp/out - """ - ] - // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 - dir: "/" - }, - { - do: "export" - // Source path in the container - source: "/tmp/out" - format: "string" - }, - ] - } + """, + ] + // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 + dir: "/" + }, + { + do: "export" + // Source path in the container + source: "/tmp/out" + format: "string" + }, + ] } diff --git a/examples/tests/export/yaml/main.cue b/examples/tests/export/yaml/main.cue index 8b0e16f3..7ec5e0c5 100644 --- a/examples/tests/export/yaml/main.cue +++ b/examples/tests/export/yaml/main.cue @@ -1,29 +1,24 @@ package testing -test: { - - #dagger: { - compute: [ - { - do: "fetch-container" - ref: "alpine" - }, - { - do: "exec" - args: ["sh", "-c", """ - echo "--- # Shopping list - [milk, pumpkin pie, eggs, juice]" > /tmp/out - """ - ] - // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 - dir: "/" - }, - { - do: "export" - // Source path in the container - source: "/tmp/out" - format: "yaml" - }, +test: #dagger: compute: [ + { + do: "fetch-container" + ref: "alpine" + }, + { + do: "exec" + args: ["sh", "-c", """ + echo "--- # Shopping list + [milk, pumpkin pie, eggs, juice]" > /tmp/out + """, ] - } -} + // XXX Blocked by https://github.com/blocklayerhq/dagger/issues/19 + dir: "/" + }, + { + do: "export" + // Source path in the container + source: "/tmp/out" + format: "yaml" + }, +] diff --git a/examples/tests/fetch-container/exist/main.cue b/examples/tests/fetch-container/exist/main.cue index bfd36bee..14ba7177 100644 --- a/examples/tests/fetch-container/exist/main.cue +++ b/examples/tests/fetch-container/exist/main.cue @@ -1,46 +1,36 @@ package testing -busybox1: { - #dagger: compute: [ - { - do: "fetch-container" - ref: "busybox" - }, - ] -} +busybox1: #dagger: compute: [ + { + do: "fetch-container" + ref: "busybox" + }, +] -busybox2: { - #dagger: compute: [ - { - do: "fetch-container" - ref: "busybox:latest" - }, - ] -} +busybox2: #dagger: compute: [ + { + do: "fetch-container" + ref: "busybox:latest" + }, +] -busybox3: { - #dagger: compute: [ - { - do: "fetch-container" - ref: "busybox:1.33-musl" - }, - ] -} +busybox3: #dagger: compute: [ + { + do: "fetch-container" + ref: "busybox:1.33-musl" + }, +] -busybox4: { - #dagger: compute: [ - { - do: "fetch-container" - ref: "busybox@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7" - }, - ] -} +busybox4: #dagger: compute: [ + { + do: "fetch-container" + ref: "busybox@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7" + }, +] -busybox5: { - #dagger: compute: [ - { - do: "fetch-container" - ref: "busybox:1.33-musl@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7" - }, - ] -} +busybox5: #dagger: compute: [ + { + do: "fetch-container" + ref: "busybox:1.33-musl@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7" + }, +] diff --git a/examples/tests/fetch-container/nonexistent/digest/main.cue b/examples/tests/fetch-container/nonexistent/digest/main.cue index 32e02b9b..5ea3c46d 100644 --- a/examples/tests/fetch-container/nonexistent/digest/main.cue +++ b/examples/tests/fetch-container/nonexistent/digest/main.cue @@ -2,7 +2,7 @@ package testing #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine@sha256:c6c7524e2111f22a9f7577211232d89a9e68cf5b9ed4a41ba77957c9771380a5" - } + }, ] diff --git a/examples/tests/fetch-container/nonexistent/image-with-valid-digest/main.cue b/examples/tests/fetch-container/nonexistent/image-with-valid-digest/main.cue index 187d96d7..c0c1b8bb 100644 --- a/examples/tests/fetch-container/nonexistent/image-with-valid-digest/main.cue +++ b/examples/tests/fetch-container/nonexistent/image-with-valid-digest/main.cue @@ -4,7 +4,7 @@ package testing // Once buildkit has pulled that digest, it will stay cached and happily succeed WHATEVER the image name then is #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "busyboxaaa@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7" }, ] diff --git a/examples/tests/fetch-container/nonexistent/image/main.cue b/examples/tests/fetch-container/nonexistent/image/main.cue index e907a15e..6aff0857 100644 --- a/examples/tests/fetch-container/nonexistent/image/main.cue +++ b/examples/tests/fetch-container/nonexistent/image/main.cue @@ -2,7 +2,7 @@ package testing #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "doesnotexist" - } + }, ] diff --git a/examples/tests/fetch-container/nonexistent/tag/main.cue b/examples/tests/fetch-container/nonexistent/tag/main.cue index 622c623e..4db028a8 100644 --- a/examples/tests/fetch-container/nonexistent/tag/main.cue +++ b/examples/tests/fetch-container/nonexistent/tag/main.cue @@ -2,7 +2,7 @@ package testing #dagger: compute: [ { - do: "fetch-container" + do: "fetch-container" ref: "alpine:doesnotexist" - } + }, ] diff --git a/examples/tests/fetch-git/exist/main.cue b/examples/tests/fetch-git/exist/main.cue index 4e7cee90..b8022d5e 100644 --- a/examples/tests/fetch-git/exist/main.cue +++ b/examples/tests/fetch-git/exist/main.cue @@ -1,11 +1,9 @@ package testing -#dagger: { - compute: [ - { - do: "fetch-git" - remote: "https://github.com/blocklayerhq/acme-clothing.git" - ref: "master" - } - ] -} +#dagger: compute: [ + { + do: "fetch-git" + remote: "https://github.com/blocklayerhq/acme-clothing.git" + ref: "master" + }, +] diff --git a/examples/tests/fetch-git/invalid/main.cue b/examples/tests/fetch-git/invalid/main.cue index f5ad8568..60f9ec17 100644 --- a/examples/tests/fetch-git/invalid/main.cue +++ b/examples/tests/fetch-git/invalid/main.cue @@ -1,9 +1,7 @@ package testing -#dagger: { - compute: [ - { - do: "fetch-git" - } - ] -} +#dagger: compute: [ + { + do: "fetch-git" + }, +] diff --git a/examples/tests/fetch-git/nonexistent/bork/main.cue b/examples/tests/fetch-git/nonexistent/bork/main.cue index d637ef89..a9ddbb6b 100644 --- a/examples/tests/fetch-git/nonexistent/bork/main.cue +++ b/examples/tests/fetch-git/nonexistent/bork/main.cue @@ -1,11 +1,9 @@ package testing -#dagger: { - compute: [ - { - do: "fetch-git" - remote: "pork://pork" - ref: "master" - } - ] -} +#dagger: compute: [ + { + do: "fetch-git" + remote: "pork://pork" + ref: "master" + }, +] diff --git a/examples/tests/fetch-git/nonexistent/ref/main.cue b/examples/tests/fetch-git/nonexistent/ref/main.cue index 1921d807..834bc0d3 100644 --- a/examples/tests/fetch-git/nonexistent/ref/main.cue +++ b/examples/tests/fetch-git/nonexistent/ref/main.cue @@ -1,11 +1,9 @@ package testing -#dagger: { - compute: [ - { - do: "fetch-git" - remote: "https://github.com/blocklayerhq/acme-clothing.git" - ref: "lalalalal" - } - ] -} +#dagger: compute: [ + { + do: "fetch-git" + remote: "https://github.com/blocklayerhq/acme-clothing.git" + ref: "lalalalal" + }, +] diff --git a/examples/tests/fetch-git/nonexistent/remote/main.cue b/examples/tests/fetch-git/nonexistent/remote/main.cue index f2ada07e..b78cf90b 100644 --- a/examples/tests/fetch-git/nonexistent/remote/main.cue +++ b/examples/tests/fetch-git/nonexistent/remote/main.cue @@ -1,11 +1,9 @@ package testing -#dagger: { - compute: [ - { - do: "fetch-git" - remote: "https://github.com/blocklayerhq/lalalala.git" - ref: "master" - } - ] -} +#dagger: compute: [ + { + do: "fetch-git" + remote: "https://github.com/blocklayerhq/lalalala.git" + ref: "master" + }, +] diff --git a/examples/tests/load/invalid/cache/main.cue b/examples/tests/load/invalid/cache/main.cue index 7e9a89c2..d267a518 100644 --- a/examples/tests/load/invalid/cache/main.cue +++ b/examples/tests/load/invalid/cache/main.cue @@ -3,35 +3,31 @@ package testing test1: { string - #dagger: { - compute: [ - { - do: "load" - from: [{do: "fetch-container", ref: "alpine"}] - }, - { - do: "export" - source: "/etc/issue" - format: "string" - }, - ] - } + #dagger: compute: [ + { + do: "load" + from: [{do: "fetch-container", ref: "alpine"}] + }, + { + do: "export" + source: "/etc/issue" + format: "string" + }, + ] } test2: { string - #dagger: { - compute: [ - { - do: "load" - from: [{do: "fetch-container", ref: "busybox"}] - }, - { - do: "export" - source: "/etc/issue" - format: "string" - }, - ] - } + #dagger: compute: [ + { + do: "load" + from: [{do: "fetch-container", ref: "busybox"}] + }, + { + do: "export" + source: "/etc/issue" + format: "string" + }, + ] } diff --git a/examples/tests/load/valid/component/main.cue b/examples/tests/load/valid/component/main.cue index 70442b41..172c9208 100644 --- a/examples/tests/load/valid/component/main.cue +++ b/examples/tests/load/valid/component/main.cue @@ -1,57 +1,53 @@ package testing component: #dagger: compute: [{ - do: "fetch-container" + do: "fetch-container" ref: "alpine" }, { do: "exec" args: ["sh", "-c", """ - printf lol > /id - """] + printf lol > /id + """] dir: "/" }] test1: { string - #dagger: { - compute: [ - { - do: "load" - from: component - }, - { - do: "export" - source: "/id" - format: "string" - }, - ] - } + #dagger: compute: [ + { + do: "load" + from: component + }, + { + do: "export" + source: "/id" + format: "string" + }, + ] } test2: { string - #dagger: { - compute: [ - { - do: "load" - from: #dagger: compute: [{ - do: "fetch-container" - ref: "alpine" - }, { - do: "exec" - args: ["sh", "-c", """ + #dagger: compute: [ + { + do: "load" + from: #dagger: compute: [{ + do: "fetch-container" + ref: "alpine" + }, { + do: "exec" + args: ["sh", "-c", """ printf lol > /id """] - dir: "/" - }] - }, - { - do: "export" - source: "/id" - format: "string" - }, - ] - } + dir: "/" + }] + }, + { + do: "export" + source: "/id" + format: "string" + }, + ] } diff --git a/examples/tests/load/valid/script/main.cue b/examples/tests/load/valid/script/main.cue index a9ccaf6c..aa1a36e6 100644 --- a/examples/tests/load/valid/script/main.cue +++ b/examples/tests/load/valid/script/main.cue @@ -1,20 +1,17 @@ package testing - test: { string - #dagger: { - compute: [ - { - do: "load" - from: [{do: "fetch-container", ref: "alpine"}] - }, - { - do: "export" - source: "/etc/issue" - format: "string" - }, - ] - } + #dagger: compute: [ + { + do: "load" + from: [{do: "fetch-container", ref: "alpine"}] + }, + { + do: "export" + source: "/etc/issue" + format: "string" + }, + ] } diff --git a/examples/tests/mounts/valid/cache/main.cue b/examples/tests/mounts/valid/cache/main.cue index fd91825d..8ec463d3 100644 --- a/examples/tests/mounts/valid/cache/main.cue +++ b/examples/tests/mounts/valid/cache/main.cue @@ -3,25 +3,23 @@ package testing test: { string - #dagger: { - compute: [ - { - do: "load" - from: [{do: "fetch-container", ref: "alpine"}] - }, - { - do: "exec" - args: ["sh", "-c", """ + #dagger: compute: [ + { + do: "load" + from: [{do: "fetch-container", ref: "alpine"}] + }, + { + do: "exec" + args: ["sh", "-c", """ echo "NOT SURE WHAT TO TEST YET" > /out """] - dir: "/" - mount: something: "cache" - }, - { - do: "export" - source: "/out" - format: "string" - }, - ] - } + dir: "/" + mount: something: "cache" + }, + { + do: "export" + source: "/out" + format: "string" + }, + ] } diff --git a/examples/tests/mounts/valid/component/main.cue b/examples/tests/mounts/valid/component/main.cue index cbb25b41..b6d78345 100644 --- a/examples/tests/mounts/valid/component/main.cue +++ b/examples/tests/mounts/valid/component/main.cue @@ -3,31 +3,29 @@ package testing test: { string - #dagger: { - compute: [ - { - do: "load" - from: [{do: "fetch-container", ref: "alpine"}] - }, - { - do: "exec" - args: ["sh", "-c", """ + #dagger: compute: [ + { + do: "load" + from: [{do: "fetch-container", ref: "alpine"}] + }, + { + do: "exec" + args: ["sh", "-c", """ ls -lA /lol > /out """] - dir: "/" - mount: something: { - input: dagger: #compute: [{ - do: "fetch-container" - ref: "alpine" - }] - path: "/lol" - } - }, - { - do: "export" - source: "/out" - format: "string" - }, - ] - } + dir: "/" + mount: something: { + input: dagger: #compute: [{ + do: "fetch-container" + ref: "alpine" + }] + path: "/lol" + } + }, + { + do: "export" + source: "/out" + format: "string" + }, + ] } diff --git a/examples/tests/mounts/valid/script/main.cue b/examples/tests/mounts/valid/script/main.cue index 9064da9a..781e5c52 100644 --- a/examples/tests/mounts/valid/script/main.cue +++ b/examples/tests/mounts/valid/script/main.cue @@ -3,31 +3,29 @@ package testing test: { string - #dagger: { - compute: [ - { - do: "load" - from: [{do: "fetch-container", ref: "alpine"}] - }, - { - do: "exec" - args: ["sh", "-c", """ + #dagger: compute: [ + { + do: "load" + from: [{do: "fetch-container", ref: "alpine"}] + }, + { + do: "exec" + args: ["sh", "-c", """ ls -lA /lol > /out """] - dir: "/" - mount: something: { - input: [{ - do: "fetch-container" - ref: "alpine" - }] - path: "/lol" - } - }, - { - do: "export" - source: "/out" - format: "string" - }, - ] - } + dir: "/" + mount: something: { + input: [{ + do: "fetch-container" + ref: "alpine" + }] + path: "/lol" + } + }, + { + do: "export" + source: "/out" + format: "string" + }, + ] } diff --git a/examples/tests/mounts/valid/tmpfs/main.cue b/examples/tests/mounts/valid/tmpfs/main.cue index 20b46d25..974c3dd8 100644 --- a/examples/tests/mounts/valid/tmpfs/main.cue +++ b/examples/tests/mounts/valid/tmpfs/main.cue @@ -3,25 +3,23 @@ package testing test: { string - #dagger: { - compute: [ - { - do: "load" - from: [{do: "fetch-container", ref: "alpine"}] - }, - { - do: "exec" - args: ["sh", "-c", """ + #dagger: compute: [ + { + do: "load" + from: [{do: "fetch-container", ref: "alpine"}] + }, + { + do: "exec" + args: ["sh", "-c", """ echo "NOT SURE WHAT TO TEST YET" > /out """] - dir: "/" - mount: something: "tmpfs" - }, - { - do: "export" - source: "/out" - format: "string" - }, - ] - } + dir: "/" + mount: something: "tmpfs" + }, + { + do: "export" + source: "/out" + format: "string" + }, + ] }