Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
Fix Kops schema, and add new instance_vars for set-pipeline (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
ari-becker authored Mar 21, 2021
1 parent 64718d1 commit 5895491
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }

Expand Down
5 changes: 5 additions & 0 deletions Step.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -210,13 +211,17 @@ 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
, default =
{ 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
Expand Down
2 changes: 1 addition & 1 deletion domain.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.dhall
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions resource-types/Kops.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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"
}
Expand Down
2 changes: 1 addition & 1 deletion resource-types/package.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@
./Time.dhall sha256:31a94594fb11d939559befed5307954463d9832fc0c9e085455ebb08689932e2
? ./Time.dhall
, Kops =
./Kops.dhall sha256:3b3a0a12571d7bcaa892d4f5b517a13be7f951a33c53ae77e346286cf8084b37
./Kops.dhall sha256:362b724a62db7292902efa8d27886bfb713a91db523c1459828861e09e33727c
? ./Kops.dhall
}

0 comments on commit 5895491

Please sign in to comment.