Merge pull request #1704 from helderco/inputs-outputs-cleanup
Inputs/outputs cleanup
This commit is contained in:
@@ -5,10 +5,10 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
inputs: directories: testdata: path: "./testdata"
|
||||
client: filesystem: testdata: read: contents: dagger.#FS
|
||||
|
||||
actions: build: dagger.#Dockerfile & {
|
||||
source: inputs.directories.testdata.contents
|
||||
source: client.filesystem.testdata.read.contents
|
||||
dockerfile: contents: """
|
||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||
ARG TEST=foo
|
||||
|
@@ -5,22 +5,23 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
inputs: {
|
||||
directories: testdata: path: "./testdata"
|
||||
secrets: sops: command: {
|
||||
client: {
|
||||
filesystem: testdata: read: contents: dagger.#FS
|
||||
commands: sops: {
|
||||
name: "sops"
|
||||
args: ["-d", "../../secrets_sops.yaml"]
|
||||
stdout: dagger.#Secret
|
||||
}
|
||||
}
|
||||
|
||||
actions: {
|
||||
sopsSecrets: dagger.#DecodeSecret & {
|
||||
format: "yaml"
|
||||
input: inputs.secrets.sops.contents
|
||||
input: client.commands.sops.stdout
|
||||
}
|
||||
|
||||
build: dagger.#Dockerfile & {
|
||||
source: inputs.directories.testdata.contents
|
||||
source: client.filesystem.testdata.read.contents
|
||||
auth: "daggerio/ci-test:private-pull": {
|
||||
username: "daggertest"
|
||||
secret: sopsSecrets.output.DOCKERHUB_TOKEN.contents
|
||||
|
@@ -5,11 +5,11 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
inputs: directories: testdata: path: "./testdata"
|
||||
client: filesystem: testdata: read: contents: dagger.#FS
|
||||
|
||||
actions: {
|
||||
build: dagger.#Dockerfile & {
|
||||
source: inputs.directories.testdata.contents
|
||||
source: client.filesystem.testdata.read.contents
|
||||
}
|
||||
|
||||
verify: dagger.#Exec & {
|
||||
|
@@ -5,11 +5,11 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
inputs: directories: testdata: path: "./testdata"
|
||||
client: filesystem: testdata: read: contents: dagger.#FS
|
||||
|
||||
actions: {
|
||||
build: dagger.#Dockerfile & {
|
||||
source: inputs.directories.testdata.contents
|
||||
source: client.filesystem.testdata.read.contents
|
||||
dockerfile: path: "./dockerfilepath/Dockerfile.custom"
|
||||
}
|
||||
|
||||
|
@@ -5,12 +5,12 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
inputs: directories: testdata: path: "./testdata"
|
||||
client: filesystem: testdata: read: contents: dagger.#FS
|
||||
|
||||
actions: {
|
||||
// FIXME: this doesn't test anything beside not crashing
|
||||
build: dagger.#Dockerfile & {
|
||||
source: inputs.directories.testdata.contents
|
||||
source: client.filesystem.testdata.read.contents
|
||||
dockerfile: contents: """
|
||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||
ENV test foobar
|
||||
|
@@ -5,11 +5,11 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
inputs: directories: testdata: path: "./testdata"
|
||||
client: filesystem: testdata: read: contents: dagger.#FS
|
||||
|
||||
actions: {
|
||||
build: dagger.#Dockerfile & {
|
||||
source: inputs.directories.testdata.contents
|
||||
source: client.filesystem.testdata.read.contents
|
||||
dockerfile: contents: """
|
||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||
RUN echo foobar > /output
|
||||
|
@@ -5,11 +5,11 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
inputs: directories: testdata: path: "./testdata"
|
||||
client: filesystem: testdata: read: contents: dagger.#FS
|
||||
|
||||
actions: {
|
||||
build: dagger.#Dockerfile & {
|
||||
source: inputs.directories.testdata.contents
|
||||
source: client.filesystem.testdata.read.contents
|
||||
dockerfile: contents: """
|
||||
# syntax = docker/dockerfile:1.3
|
||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||
|
@@ -5,12 +5,12 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
inputs: directories: testdata: path: "./testdata"
|
||||
client: filesystem: testdata: read: contents: dagger.#FS
|
||||
|
||||
actions: {
|
||||
// FIXME: this doesn't test anything beside not crashing
|
||||
build: dagger.#Dockerfile & {
|
||||
source: inputs.directories.testdata.contents
|
||||
source: client.filesystem.testdata.read.contents
|
||||
dockerfile: contents: """
|
||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||
"""
|
||||
|
@@ -5,12 +5,12 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
inputs: directories: testdata: path: "./testdata"
|
||||
client: filesystem: testdata: read: contents: dagger.#FS
|
||||
|
||||
actions: {
|
||||
// FIXME: this doesn't test anything beside not crashing
|
||||
build: dagger.#Dockerfile & {
|
||||
source: inputs.directories.testdata.contents
|
||||
source: client.filesystem.testdata.read.contents
|
||||
dockerfile: contents: """
|
||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||
"""
|
||||
|
@@ -5,7 +5,7 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
inputs: secrets: testSecret: path: "secret.txt"
|
||||
client: filesystem: "secret.txt": read: contents: dagger.#Secret
|
||||
actions: {
|
||||
image: dagger.#Pull & {
|
||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||
@@ -13,7 +13,7 @@ dagger.#Plan & {
|
||||
|
||||
verify: dagger.#Exec & {
|
||||
input: image.output
|
||||
env: TEST: inputs.secrets.testSecret.contents
|
||||
env: TEST: client.filesystem."secret.txt".read.contents
|
||||
args: [
|
||||
"sh", "-c",
|
||||
#"""
|
||||
|
@@ -5,7 +5,7 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
inputs: secrets: testSecret: envvar: "TESTSECRET"
|
||||
client: env: TESTSECRET: dagger.#Secret
|
||||
actions: {
|
||||
image: dagger.#Pull & {
|
||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||
@@ -15,7 +15,7 @@ dagger.#Plan & {
|
||||
input: image.output
|
||||
mounts: secret: {
|
||||
dest: "/run/secrets/test"
|
||||
contents: inputs.secrets.testSecret.contents
|
||||
contents: client.env.TESTSECRET
|
||||
}
|
||||
args: [
|
||||
"sh", "-c",
|
||||
@@ -30,7 +30,7 @@ dagger.#Plan & {
|
||||
input: image.output
|
||||
mounts: secret: {
|
||||
dest: "/run/secrets/test"
|
||||
contents: inputs.secrets.testSecret.contents
|
||||
contents: client.env.TESTSECRET
|
||||
uid: 42
|
||||
gid: 24
|
||||
mask: 0o666
|
||||
|
@@ -5,7 +5,7 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
proxy: dockerSocket: unix: "/var/run/docker.sock"
|
||||
client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Service
|
||||
|
||||
actions: {
|
||||
image: dagger.#Pull & {
|
||||
@@ -21,7 +21,7 @@ dagger.#Plan & {
|
||||
input: imageWithDocker.output
|
||||
mounts: docker: {
|
||||
dest: "/var/run/docker.sock"
|
||||
contents: proxy.dockerSocket.service
|
||||
contents: client.filesystem."/var/run/docker.sock".read.contents
|
||||
}
|
||||
args: ["docker", "info"]
|
||||
}
|
||||
|
@@ -5,9 +5,10 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
inputs: secrets: sops: command: {
|
||||
client: commands: sops: {
|
||||
name: "sops"
|
||||
args: ["-d", "../../secrets_sops.yaml"]
|
||||
args: ["-d", "secrets_sops.yaml"]
|
||||
stdout: dagger.#Secret
|
||||
}
|
||||
|
||||
actions: {
|
||||
@@ -18,7 +19,7 @@ dagger.#Plan & {
|
||||
|
||||
sopsSecrets: dagger.#DecodeSecret & {
|
||||
format: "yaml"
|
||||
input: inputs.secrets.sops.contents
|
||||
input: client.commands.sops.stdout
|
||||
}
|
||||
|
||||
testRepo: dagger.#GitPull & {
|
||||
|
@@ -5,15 +5,16 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
inputs: secrets: sops: command: {
|
||||
client: commands: sops: {
|
||||
name: "sops"
|
||||
args: ["-d", "../../secrets_sops.yaml"]
|
||||
args: ["-d", "secrets_sops.yaml"]
|
||||
stdout: dagger.#Secret
|
||||
}
|
||||
|
||||
actions: {
|
||||
sopsSecrets: dagger.#DecodeSecret & {
|
||||
format: "yaml"
|
||||
input: inputs.secrets.sops.contents
|
||||
input: client.commands.sops.stdout
|
||||
}
|
||||
|
||||
pull: dagger.#Pull & {
|
||||
|
@@ -6,9 +6,10 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
inputs: secrets: sops: command: {
|
||||
client: commands: sops: {
|
||||
name: "sops"
|
||||
args: ["-d", "../../secrets_sops.yaml"]
|
||||
args: ["-d", "secrets_sops.yaml"]
|
||||
stdout: dagger.#Secret
|
||||
}
|
||||
|
||||
#auth: {
|
||||
@@ -17,10 +18,9 @@ dagger.#Plan & {
|
||||
}
|
||||
|
||||
actions: {
|
||||
|
||||
sopsSecrets: dagger.#DecodeSecret & {
|
||||
format: "yaml"
|
||||
input: inputs.secrets.sops.contents
|
||||
input: client.commands.sops.stdout
|
||||
}
|
||||
|
||||
randomString: {
|
||||
|
Reference in New Issue
Block a user