Merge pull request #1704 from helderco/inputs-outputs-cleanup
Inputs/outputs cleanup
This commit is contained in:
@@ -7,15 +7,16 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
inputs: secrets: sops: command: {
|
||||
client: commands: sops: {
|
||||
name: "sops"
|
||||
args: ["-d", "--extract", "[\"AWS\"]", "../../../secrets_sops.yaml"]
|
||||
stdout: dagger.#Secret
|
||||
}
|
||||
|
||||
actions: {
|
||||
sopsSecrets: dagger.#DecodeSecret & {
|
||||
format: "yaml"
|
||||
input: inputs.secrets.sops.contents
|
||||
input: client.commands.sops.stdout
|
||||
}
|
||||
|
||||
getCallerIdentity: cli.#Command & {
|
||||
|
@@ -7,27 +7,27 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
inputs: {
|
||||
directories: awsConfig: {
|
||||
path: "./"
|
||||
client: {
|
||||
filesystem: ".": read: {
|
||||
contents: dagger.#FS
|
||||
include: ["config"]
|
||||
}
|
||||
|
||||
secrets: sops: command: {
|
||||
commands: sops: {
|
||||
name: "sops"
|
||||
args: ["-d", "--extract", "[\"AWS\"]", "../../secrets_sops.yaml"]
|
||||
stdout: dagger.#Secret
|
||||
}
|
||||
}
|
||||
|
||||
actions: {
|
||||
sopsSecrets: dagger.#DecodeSecret & {
|
||||
format: "yaml"
|
||||
input: inputs.secrets.sops.contents
|
||||
input: client.commands.sops.stdout
|
||||
}
|
||||
|
||||
getCallerIdentity: aws.#Container & {
|
||||
always: true
|
||||
configFile: inputs.directories.awsConfig.contents
|
||||
configFile: client.filesystem.".".read.contents
|
||||
|
||||
credentials: aws.#Credentials & {
|
||||
accessKeyId: sopsSecrets.output.AWS_ACCESS_KEY_ID.contents
|
||||
|
@@ -7,15 +7,16 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
inputs: secrets: sops: command: {
|
||||
client: commands: sops: {
|
||||
name: "sops"
|
||||
args: ["-d", "--extract", "[\"AWS\"]", "../../secrets_sops.yaml"]
|
||||
stdout: dagger.#Secret
|
||||
}
|
||||
|
||||
actions: {
|
||||
sopsSecrets: dagger.#DecodeSecret & {
|
||||
format: "yaml"
|
||||
input: inputs.secrets.sops.contents
|
||||
input: client.commands.sops.stdout
|
||||
}
|
||||
|
||||
getCallerIdentity: aws.#Container & {
|
||||
|
@@ -8,14 +8,14 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
inputs: directories: testhello: path: "./data/hello"
|
||||
client: filesystem: "./data/hello": read: contents: dagger.#FS
|
||||
|
||||
actions: tests: build: {
|
||||
_baseImage: alpine.#Build
|
||||
|
||||
simple: {
|
||||
build: go.#Build & {
|
||||
source: inputs.directories.testhello.contents
|
||||
source: client.filesystem."./data/hello".read.contents
|
||||
}
|
||||
|
||||
exec: docker.#Run & {
|
||||
|
@@ -5,6 +5,8 @@ setup() {
|
||||
}
|
||||
|
||||
@test "bash" {
|
||||
dagger up
|
||||
dagger up ./build.cue
|
||||
dagger up ./container.cue
|
||||
dagger up ./image.cue
|
||||
dagger up ./test.cue
|
||||
}
|
||||
|
||||
|
@@ -6,10 +6,10 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
inputs: directories: testhello: path: "./data/hello"
|
||||
client: filesystem: "./data/hello": read: contents: dagger.#FS
|
||||
|
||||
actions: tests: test: simple: go.#Test & {
|
||||
source: inputs.directories.testhello.contents
|
||||
source: client.filesystem."./data/hello".read.contents
|
||||
package: "./greeting"
|
||||
}
|
||||
}
|
||||
|
@@ -10,9 +10,10 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
inputs: secrets: test: command: {
|
||||
client: commands: sops: {
|
||||
name: "sops"
|
||||
args: ["-d", "../../test_secrets.yaml"]
|
||||
stdout: dagger.#Secret
|
||||
}
|
||||
|
||||
actions: tests: {
|
||||
@@ -20,7 +21,7 @@ dagger.#Plan & {
|
||||
// Configuration common to all tests
|
||||
common: {
|
||||
testSecrets: dagger.#DecodeSecret & {
|
||||
input: inputs.secrets.test.contents
|
||||
input: client.commands.sops.stdout
|
||||
format: "yaml"
|
||||
}
|
||||
|
||||
|
@@ -8,16 +8,16 @@ import (
|
||||
)
|
||||
|
||||
dagger.#Plan & {
|
||||
inputs: directories: {
|
||||
testdata: path: "./data/foo"
|
||||
testdata2: path: "./data/bar"
|
||||
client: filesystem: {
|
||||
"./data/foo": read: contents: dagger.#FS
|
||||
"./data/bar": read: contents: dagger.#FS
|
||||
}
|
||||
|
||||
actions: tests: {
|
||||
|
||||
// Configuration for all tests
|
||||
common: {
|
||||
data: inputs.directories.testdata.contents
|
||||
data: client.filesystem."./data/foo".read.contents
|
||||
}
|
||||
|
||||
// Run yarn.#Build
|
||||
|
Reference in New Issue
Block a user