From 58954918dcffbf7a69fabff9f4cff7d3d9666ae7 Mon Sep 17 00:00:00 2001 From: Ari Becker Date: Sun, 21 Mar 2021 12:27:14 +0200 Subject: [PATCH] Fix Kops schema, and add new `instance_vars` for `set-pipeline` (#23) --- README.md | 12 ++++++------ Step.dhall | 5 +++++ domain.dhall | 2 +- package.dhall | 2 +- resource-types/Kops.dhall | 4 ++-- resource-types/package.dhall | 2 +- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 9f21478..adeb745 100644 --- a/README.md +++ b/README.md @@ -33,11 +33,11 @@ For stability, users are encouraged to import from a tagged release, not from th You should generally import `domain.dhall`, which includes `Resource`, `ResourceType`, `Step`, `Task`, `Job`, `Group`, `Pipeline`, and `VarSource`, and merge it with the resource types that you need. For example, ```dhall let Concourse = - https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.13.0/domain.dhall sha256:036b9de47a7f54d4ed21b87c50987fb8a318c62524d7f6317d3ec98bbe9c784c + https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.14.0/domain.dhall sha256:56c38498a9f9ed945c76a1e8e880532151666850e78e82c05f4a56bcebeee00f ∧ { RegistryImage = - https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.13.0/resource-types/RegistryImage.dhall sha256:2ca4df79f82f54275f919d759344a6478749f7d0f32bddbc0389877ede11da03 + https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.14.0/resource-types/RegistryImage.dhall sha256:2ca4df79f82f54275f919d759344a6478749f7d0f32bddbc0389877ede11da03 , Git = - https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.13.0/resource-types/Git.dhall sha256:830b9d7d0e9e0992ee2473f78e05838a86be3e13c7bcf5df661b8829dbc3d558 + https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.14.0/resource-types/Git.dhall sha256:830b9d7d0e9e0992ee2473f78e05838a86be3e13c7bcf5df661b8829dbc3d558 } in Concourse @@ -65,16 +65,16 @@ This introduces a question - what should the type of the `source` field be? Main This repository allows the user to construct the type of `Resource` and of `ResourceType` based on a union that the downstream user constructs, consisting only of the resource types which the downstream user actually uses in their pipeline. This solves both the code-reusage problem, and keeps the implementation performant. For example: ```dhall -let Git = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.13.0/resource-types/Git.dhall sha256:830b9d7d0e9e0992ee2473f78e05838a86be3e13c7bcf5df661b8829dbc3d558 +let Git = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.14.0/resource-types/Git.dhall sha256:830b9d7d0e9e0992ee2473f78e05838a86be3e13c7bcf5df661b8829dbc3d558 -let S3 = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.13.0/resource-types/S3.dhall sha256:b49ec06747630f6d6951fde4f04f7bbffab7cee1a9ef299464314ad049422d04 +let S3 = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.14.0/resource-types/S3.dhall sha256:b49ec06747630f6d6951fde4f04f7bbffab7cee1a9ef299464314ad049422d04 let Source = < Git : Git.Source.Type | S3 : S3.Source.Type > let Version = < Git : Git.Version.Type | S3 : S3.Version.Type > let Resource = - let import = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.13.0/Resource.dhall sha256:206f784b14f3fb78809bafffbde955fbc177ca0427c8fe9cf4a983a8aaf463c1 + let import = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.14.0/Resource.dhall sha256:206f784b14f3fb78809bafffbde955fbc177ca0427c8fe9cf4a983a8aaf463c1 in import { Source, Version } diff --git a/Step.dhall b/Step.dhall index 98b9275..d8ff319 100644 --- a/Step.dhall +++ b/Step.dhall @@ -189,6 +189,7 @@ let SetPipeline { file : Optional Text , vars : Optional (List { mapKey : Text, mapValue : Text }) , var_files : Optional (List Text) + , instance_vars : Optional (List { mapKey : Text, mapValue : Text }) , team : Optional Text , timeout : Optional Text , attempts : Optional Natural @@ -210,6 +211,8 @@ let SetPipeline , file : Optional Text , vars : Optional (List { mapKey : Text, mapValue : Text }) , var_files : Optional (List Text) + , instance_vars : + Optional (List { mapKey : Text, mapValue : Text }) , team : Optional Text } ⩓ Hooks.Type @@ -217,6 +220,8 @@ let SetPipeline { file = None Text , vars = None (List { mapKey : Text, mapValue : Text }) , var_files = None (List Text) + , instance_vars = + None (List { mapKey : Text, mapValue : Text }) , team = None Text } ∧ Hooks.default diff --git a/domain.dhall b/domain.dhall index 3a53c9e..607cd93 100644 --- a/domain.dhall +++ b/domain.dhall @@ -5,7 +5,7 @@ ./ResourceType.dhall sha256:41ead24540852689f7d08893e4f354358a26696b1d96762e5b188615a031cc06 ? ./ResourceType.dhall , Step = - ./Step.dhall sha256:496795f751710c5feb68f8e70f685a095e81d826d9e376359609103b966266de + ./Step.dhall sha256:7c6da76f543a87dcdd793b87937cf6854851547e1f8b3b81c7f7f5b01d413cef ? ./Step.dhall , Task = ./Task.dhall sha256:8b7677ec0ce7822074fc4e86ad3d2080379c59305d8be4971bec532468a680e6 diff --git a/package.dhall b/package.dhall index e322d37..4f1f184 100644 --- a/package.dhall +++ b/package.dhall @@ -1,5 +1,5 @@ { resource-types = - ./resource-types/package.dhall sha256:625db0cd12a374fa322b5290a504a0506a3be8a540176329b0c40142741308a6 + ./resource-types/package.dhall sha256:03db6af8ae63aa6aaab35efdc86e7cc8aac2938c908b704faca29087223e3cdd ? ./resource-types/package.dhall } ∧ ( ./domain.dhall sha256:036b9de47a7f54d4ed21b87c50987fb8a318c62524d7f6317d3ec98bbe9c784c diff --git a/resource-types/Kops.dhall b/resource-types/Kops.dhall index a7f02be..b093241 100644 --- a/resource-types/Kops.dhall +++ b/resource-types/Kops.dhall @@ -9,7 +9,7 @@ let Source = { Type = { aws_access_key_id : Text - , aws_access_secret_key : Text + , aws_secret_access_key : Text , cluster : Text , state_bucket : Text } @@ -19,7 +19,7 @@ let test = Source::{ , aws_access_key_id = "AWS Access Key ID" - , aws_access_secret_key = "AWS Access Secret Key" + , aws_secret_access_key = "AWS Access Secret Key" , cluster = "mycluster.k8s.cluster.local" , state_bucket = "s3://my-state-bucket" } diff --git a/resource-types/package.dhall b/resource-types/package.dhall index ab82bb8..9599549 100644 --- a/resource-types/package.dhall +++ b/resource-types/package.dhall @@ -47,6 +47,6 @@ ./Time.dhall sha256:31a94594fb11d939559befed5307954463d9832fc0c9e085455ebb08689932e2 ? ./Time.dhall , Kops = - ./Kops.dhall sha256:3b3a0a12571d7bcaa892d4f5b517a13be7f951a33c53ae77e346286cf8084b37 + ./Kops.dhall sha256:362b724a62db7292902efa8d27886bfb713a91db523c1459828861e09e33727c ? ./Kops.dhall }