From d1454a9871aefb6d79a93c5cb3777e79295fdd63 Mon Sep 17 00:00:00 2001 From: Sam Alba Date: Tue, 15 Jun 2021 17:57:14 +0200 Subject: [PATCH] stdlib: renamed verbs to nouns Signed-off-by: Sam Alba --- examples/jamstack/backend.cue | 13 +++++++------ examples/jamstack/database.cue | 4 ++-- stdlib/aws/cloudformation/cloudformation.cue | 10 +++++----- stdlib/aws/ecr/ecr.cue | 9 +++++---- stdlib/aws/ecs/run-task.cue | 4 ++-- stdlib/aws/eks/eks.cue | 3 +-- stdlib/aws/elb/elb.cue | 1 + stdlib/aws/rds/rds.cue | 10 ++++++---- stdlib/aws/s3/s3.cue | 4 ++-- stdlib/gcp/gcr/gcr.cue | 6 ++++-- 10 files changed, 35 insertions(+), 29 deletions(-) diff --git a/examples/jamstack/backend.cue b/examples/jamstack/backend.cue index 200d389c..ad79986e 100644 --- a/examples/jamstack/backend.cue +++ b/examples/jamstack/backend.cue @@ -8,13 +8,14 @@ import ( // Backend configuration backend: { + // Source code to build this container source: git.#Repository | dagger.#Artifact @dagger(input) // Container environment variables environment: { - [string]: string @dagger(input) - } + [string]: string + } @dagger(input) // Public hostname (need to match the master domain configures on the loadbalancer) hostname: string @dagger(input) @@ -39,16 +40,16 @@ backend: { dockerfilePath: *"" | string @dagger(input) // docker build args dockerBuildArgs: { - [string]: string @dagger(input) - } + [string]: string + } @dagger(input) } // Init container runs only once when the main container starts initContainer: { command: [...string] @dagger(input) environment: { - [string]: string @dagger(input) - } + [string]: string + } @dagger(input) } } diff --git a/examples/jamstack/database.cue b/examples/jamstack/database.cue index ab3f470b..46fe445a 100644 --- a/examples/jamstack/database.cue +++ b/examples/jamstack/database.cue @@ -9,7 +9,7 @@ database: { let slug = name dbType: "mysql" | "postgresql" @dagger(input) - db: rds.#CreateDB & { + db: rds.#Database & { config: infra.awsConfig name: slug dbArn: infra.rdsInstanceArn @@ -17,7 +17,7 @@ database: { secretArn: infra.rdsAdminSecretArn } - user: rds.#CreateUser & { + user: rds.#User & { config: infra.awsConfig dbArn: infra.rdsInstanceArn "dbType": dbType diff --git a/stdlib/aws/cloudformation/cloudformation.cue b/stdlib/aws/cloudformation/cloudformation.cue index 17c0ece9..9cbb4909 100644 --- a/stdlib/aws/cloudformation/cloudformation.cue +++ b/stdlib/aws/cloudformation/cloudformation.cue @@ -1,4 +1,4 @@ -// AWS Cloud Formation +// AWS CloudFormation package cloudformation import ( @@ -23,7 +23,7 @@ import ( // Stack parameters parameters: { ... - } + } @dagger(input) // Behavior when failure to create/update the Stack onFailure: *"DO_NOTHING" | "ROLLBACK" | "DELETE" @dagger(input) @@ -32,7 +32,7 @@ import ( timeout: *10 | uint @dagger(input) // Never update the stack if already exists - neverUpdate: *false | bool @dagger(input) + neverUpdate: *false | true @dagger(input) #files: { "/entrypoint.sh": #Code @@ -48,8 +48,8 @@ import ( } outputs: { - [string]: string @dagger(output) - } + [string]: string + } @dagger(output) outputs: #up: [ op.#Load & { diff --git a/stdlib/aws/ecr/ecr.cue b/stdlib/aws/ecr/ecr.cue index cf2cd5a2..dd9fa446 100644 --- a/stdlib/aws/ecr/ecr.cue +++ b/stdlib/aws/ecr/ecr.cue @@ -6,13 +6,13 @@ import ( "dagger.io/os" ) -// Convert AWS credentials to Docker Registry credentials for ECR +// Convert ECR credentials to Docker Login format #Credentials: { // AWS Config config: aws.#Config - // ECR credentials - username: "AWS" + // ECR registry + username: "AWS" @dagger(output) ctr: os.#Container & { image: aws.#CLI & { @@ -22,10 +22,11 @@ import ( command: "aws ecr get-login-password > /out" } + // ECR registry secret secret: { os.#File & { from: ctr path: "/out" } - }.read.data + }.read.data @dagger(output) } diff --git a/stdlib/aws/ecs/run-task.cue b/stdlib/aws/ecs/run-task.cue index 3e6e0b0e..06b848de 100644 --- a/stdlib/aws/ecs/run-task.cue +++ b/stdlib/aws/ecs/run-task.cue @@ -5,8 +5,8 @@ import ( "dagger.io/aws" ) -// RunTask implements ecs run-task for running a single container on ECS -#RunTask: { +// Task implements ecs run-task for running a single container on ECS +#Task: { // AWS Config config: aws.#Config diff --git a/stdlib/aws/eks/eks.cue b/stdlib/aws/eks/eks.cue index c7be43ec..0ac2e0b1 100644 --- a/stdlib/aws/eks/eks.cue +++ b/stdlib/aws/eks/eks.cue @@ -19,7 +19,6 @@ import ( // kubeconfig is the generated kube configuration file kubeconfig: { - @dagger(output) string #up: [ @@ -58,5 +57,5 @@ import ( format: "string" }, ] - } + } @dagger(output) } diff --git a/stdlib/aws/elb/elb.cue b/stdlib/aws/elb/elb.cue index 5c26099e..5923e75e 100644 --- a/stdlib/aws/elb/elb.cue +++ b/stdlib/aws/elb/elb.cue @@ -8,6 +8,7 @@ import ( // Returns an unused rule priority (randomized in available range) #RandomRulePriority: { + // AWS Config config: aws.#Config diff --git a/stdlib/aws/rds/rds.cue b/stdlib/aws/rds/rds.cue index 9145c308..31b429aa 100644 --- a/stdlib/aws/rds/rds.cue +++ b/stdlib/aws/rds/rds.cue @@ -8,7 +8,8 @@ import ( ) // Creates a new Database on an existing RDS Instance -#CreateDB: { +#Database: { + // AWS Config config: aws.#Config @@ -83,7 +84,8 @@ import ( } // Creates a new user credentials on an existing RDS Instance -#CreateUser: { +#User: { + // AWS Config config: aws.#Config @@ -107,7 +109,6 @@ import ( // Outputed username out: { - @dagger(output) string #up: [ @@ -188,11 +189,12 @@ import ( format: "string" }, ] - } + } @dagger(output) } // Fetches information on an existing RDS Instance #Instance: { + // AWS Config config: aws.#Config diff --git a/stdlib/aws/s3/s3.cue b/stdlib/aws/s3/s3.cue index e4fa19ed..21a2ae35 100644 --- a/stdlib/aws/s3/s3.cue +++ b/stdlib/aws/s3/s3.cue @@ -94,6 +94,7 @@ import ( // S3 Bucket sync #Sync: { + // AWS Config config: aws.#Config @@ -103,8 +104,7 @@ import ( // Target S3 URL (eg. s3:////) target: string @dagger(input) - // Files that exist in the destination but not in the - // source are deleted during sync. + // Delete files that already exist on remote destination delete: *false | bool @dagger(input) // Object content type diff --git a/stdlib/gcp/gcr/gcr.cue b/stdlib/gcp/gcr/gcr.cue index f3381a9d..5d32fa72 100644 --- a/stdlib/gcp/gcr/gcr.cue +++ b/stdlib/gcp/gcr/gcr.cue @@ -11,8 +11,10 @@ import ( // GCP Config config: gcp.#Config - // GCR credentials - username: "oauth2accesstoken" + // GCR registry username + username: "oauth2accesstoken" @dagger(output) + + // GCR registry secret secret: { string