Skip to content

Commit

Permalink
cue fmt
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Alba <sam.alba@gmail.com>
  • Loading branch information
samalba committed May 26, 2021
1 parent 7009d01 commit a4167dc
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 37 deletions.
8 changes: 6 additions & 2 deletions stdlib/aws/cloudformation/cloudformation.cue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import (
stackName: string @dagger(input)

// Stack parameters
parameters: [string]: _ @dagger(input)
parameters: {
...
}

// Behavior when failure to create/update the Stack
onFailure: *"DO_NOTHING" | "ROLLBACK" | "DELETE" @dagger(input)
Expand All @@ -44,7 +46,9 @@ import (
}
}

outputs: [string]: string @dagger(output)
outputs: {
[string]: string @dagger(output)
}

outputs: #up: [
op.#Load & {
Expand Down
4 changes: 3 additions & 1 deletion stdlib/aws/ecs/run-task.cue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ import (
taskArn: string @dagger(input)

// Environment variables of the task
containerEnvironment: [string]: string @dagger(input)
containerEnvironment: {
[string]: string @dagger(input)
}

// Container name
containerName: string @dagger(input)
Expand Down
4 changes: 2 additions & 2 deletions stdlib/aws/eks/eks.cue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
// kubeconfig is the generated kube configuration file
kubeconfig: {
// FIXME There is a problem with dagger.#Secret type
string @dagger(output)
string

#up: [
op.#Load & {
Expand Down Expand Up @@ -62,5 +62,5 @@ import (
format: "string"
},
]
}
} @dagger(output)
}
2 changes: 1 addition & 1 deletion stdlib/docker/docker.cue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import (
// Build a Docker image from the provided Dockerfile contents
// FIXME: incorporate into #Build
#ImageFromDockerfile: {
dockerfile: string @dagger(input)
dockerfile: string @dagger(input)
context: dagger.#Artifact @dagger(input)

#up: [
Expand Down
22 changes: 11 additions & 11 deletions stdlib/file/file.cue
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
)

#Create: {
filename: !="" @dagger(input)
permissions: int | *0o644 @dagger(input)
filename: !="" @dagger(input)
permissions: int | *0o644 @dagger(input)
contents: string | bytes @dagger(input)

#up: [
Expand All @@ -17,9 +17,9 @@ import (
}

#Append: {
filename: !="" @dagger(input)
permissions: int | *0o644 @dagger(input)
contents: string | bytes @dagger(input)
filename: !="" @dagger(input)
permissions: int | *0o644 @dagger(input)
contents: string | bytes @dagger(input)
from: dagger.#Artifact @dagger(input)

orig: (#read & {path: filename, "from": from}).data @dagger(output)
Expand All @@ -30,27 +30,27 @@ import (
}

#Read: {
filename: !="" @dagger(input)
filename: !="" @dagger(input)
from: dagger.#Artifact @dagger(input)
contents: (#read & {path: filename, "from": from}).data @dagger(output)
contents: (#read & {path: filename, "from": from}).data @dagger(output)
}

#read: {
path: !="" @dagger(input)
path: !="" @dagger(input)
from: dagger.#Artifact @dagger(input)
data: {
string @dagger(output)
string
#up: [
op.#Load & {"from": from},
op.#Export & {source: path},
]
}
} @dagger(output)
}

#Glob: {
glob: !="" @dagger(input)
filenames: [...string] @dagger(input)
from: dagger.#Artifact @dagger(input)
from: dagger.#Artifact @dagger(input)
files: (_#glob & {"glob": glob, "from": from}).data @dagger(output)
// trim suffix because ls always ends with newline
filenames: strings.Split(strings.TrimSuffix(files, "\n"), "\n") @dagger(output)
Expand Down
4 changes: 2 additions & 2 deletions stdlib/gcp/gcr/gcr.cue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
// GCR credentials
username: "oauth2accesstoken"
secret: {
string @dagger(output)
string

#up: [
op.#Load & {
Expand All @@ -40,5 +40,5 @@ import (
source: "/token.txt"
},
]
}
} @dagger(output)
}
4 changes: 2 additions & 2 deletions stdlib/gcp/gke/gke.cue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
// kubeconfig is the generated kube configuration file
kubeconfig: {
// FIXME There is a problem with dagger.#Secret type
string @dagger(output)
string

#up: [
op.#Load & {
Expand Down Expand Up @@ -54,7 +54,7 @@ import (
format: "string"
},
]
}
} @dagger(output)
}

#Code: #"""
Expand Down
4 changes: 2 additions & 2 deletions stdlib/git/git.cue
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
// A git repository
#Repository: {

remote: string @dagger(input)
ref: string @dagger(input)
remote: string @dagger(input)
ref: string @dagger(input)
subdir: string | *"" @dagger(input)

#up: [
Expand Down
8 changes: 6 additions & 2 deletions stdlib/go/go.cue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ import (
source: dagger.#Artifact @dagger(input)

// Environment variables
env: [string]: string @dagger(input)
env: {
[string]: string @dagger(input)
}

#up: [
op.#FetchContainer & {
Expand Down Expand Up @@ -93,7 +95,9 @@ import (
// Specify the targeted binary name
output: string @dagger(output)

env: [string]: string @dagger(input)
env: {
[string]: string @dagger(input)
}

#up: [
op.#Copy & {
Expand Down
4 changes: 3 additions & 1 deletion stdlib/js/yarn/yarn.cue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import (
source: dagger.#Artifact @dagger(input)

// Environment variables
env: [string]: string @dagger(input)
env: {
[string]: string @dagger(input)
}

// Write the contents of `environment` to this file,
// in the "envfile" format.
Expand Down
18 changes: 9 additions & 9 deletions stdlib/netlify/netlify.cue
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,25 @@ import (
// Website url
url: {
os.#File & {
from: ctr
path: "/netlify/url"
}
from: ctr
path: "/netlify/url"
}
}.read.data @dagger(output)

// Unique Deploy URL
deployUrl: {
os.#File & {
from: ctr
path: "/netlify/deployUrl"
}
from: ctr
path: "/netlify/deployUrl"
}
}.read.data @dagger(output)

// Logs URL for this deployment
logsUrl: {
os.#File & {
from: ctr
path: "/netlify/logsUrl"
}
from: ctr
path: "/netlify/logsUrl"
}
}.read.data @dagger(output)

ctr: os.#Container & {
Expand Down
8 changes: 6 additions & 2 deletions stdlib/terraform/terraform.cue
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ import (

source: dagger.#Artifact @dagger(input)

tfvars?: [string]: _ @dagger(input)
tfvars?: {
...
}

env: [string]: string @dagger(input)
env: {
[string]: string @dagger(input)
}

state: #up: [
op.#FetchContainer & {
Expand Down

0 comments on commit a4167dc

Please sign in to comment.