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

Commit

Permalink
Support Typositoire/concourse-helm3-resource (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
ari-becker authored Nov 2, 2020
1 parent 68552b1 commit 7077fbc
Show file tree
Hide file tree
Showing 4 changed files with 170 additions and 8 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This allows the user to more easily generate type-safe Concourse CI pipelines, t
* Github PR - [`telia-oss/github-pr-resource`](https://github.com/telia-oss/github-pr-resource)
* Github Release - [`concourse/github-release-resource`](https://github.com/concourse/github-release-resource)
* Git Multibranch - [`cloudfoundry-community/git-multibranch-resource`](https://github.com/cloudfoundry-community/git-multibranch-resource)
* Helm 3 - [`Typositoire/concourse-helm3-resource`](https://github.com/Typositoire/concourse-helm3-resource)
* Registry Image - [`concourse/registry-image-resource`](https://github.com/concourse/registry-image-resource)
* S3 - [`concourse/s3-resource`](https://github.com/concourse/s3-resource)
* S3 Bucket - [`18F/s3-resource-simple`](https://github.com/18F/s3-resource-simple)
Expand All @@ -29,11 +30,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.8.0/domain.dhall sha256:036b9de47a7f54d4ed21b87c50987fb8a318c62524d7f6317d3ec98bbe9c784c
https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.9.0/domain.dhall sha256:036b9de47a7f54d4ed21b87c50987fb8a318c62524d7f6317d3ec98bbe9c784c
{ RegistryImage =
https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.8.0/resource-types/RegistryImage.dhall sha256:2ca4df79f82f54275f919d759344a6478749f7d0f32bddbc0389877ede11da03
https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.9.0/resource-types/RegistryImage.dhall sha256:2ca4df79f82f54275f919d759344a6478749f7d0f32bddbc0389877ede11da03
, Git =
https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.8.0/resource-types/Git.dhall sha256:830b9d7d0e9e0992ee2473f78e05838a86be3e13c7bcf5df661b8829dbc3d558
https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.9.0/resource-types/Git.dhall sha256:830b9d7d0e9e0992ee2473f78e05838a86be3e13c7bcf5df661b8829dbc3d558
}

in Concourse
Expand Down Expand Up @@ -61,16 +62,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.8.0/resource-types/Git.dhall sha256:830b9d7d0e9e0992ee2473f78e05838a86be3e13c7bcf5df661b8829dbc3d558
let Git = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.9.0/resource-types/Git.dhall sha256:830b9d7d0e9e0992ee2473f78e05838a86be3e13c7bcf5df661b8829dbc3d558

let S3 = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.8.0/resource-types/S3.dhall sha256:b49ec06747630f6d6951fde4f04f7bbffab7cee1a9ef299464314ad049422d04
let S3 = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.9.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.8.0/Resource.dhall sha256:206f784b14f3fb78809bafffbde955fbc177ca0427c8fe9cf4a983a8aaf463c1
let import = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.9.0/Resource.dhall sha256:206f784b14f3fb78809bafffbde955fbc177ca0427c8fe9cf4a983a8aaf463c1

in import { Source, Version }

Expand Down
6 changes: 4 additions & 2 deletions package.dhall
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{ resource-types =
./resource-types/package.dhall sha256:94ec73f7b06436fa1c38b53905e059fab56546fdd51679eef802a62a5446991e
./resource-types/package.dhall sha256:44660ad120799084b30751f4e8d7a628255b6e76f0b93ab6fc0e43643328a854
? ./resource-types/package.dhall
}
./domain.dhall
( ./domain.dhall sha256:036b9de47a7f54d4ed21b87c50987fb8a318c62524d7f6317d3ec98bbe9c784c
? ./domain.dhall
)
156 changes: 156 additions & 0 deletions resource-types/Helm3.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
{ meta = { name = "helm3", repository = "typositoire/concourse-helm3-resource" }
, Version = { Type = { revision : Text, release : Text }, default = {=} }
, Params =
{ Get = let not-supported = { Type = {}, default = {=} } in not-supported
, Put =
let Values = < Text : Text | Array : List Text >

let OverrideValue =
let Common =
{ Type =
{ key : Text
, hide : Optional Bool
, type : Optional Text
, verbatim : Optional Bool
}
, default =
{ hide = None Bool, type = None Text, verbatim = None Bool }
}

let Options =
{ Path =
{ Type = Common.Type { path : Text }
, default = Common.default
}
, Value =
let Untyped =
< String : Text | Number : Natural | Bool : Bool >

in { Type = Common.Type { value : Untyped }
, default = Common.default
, Untyped
}
}

let _Type =
< Path : Options.Path.Type | Value : Options.Value.Type >

in { Type = _Type
, Path = λ(path : Options.Path.Type) _Type.Path path
, Value = λ(value : Options.Value.Type) _Type.Value value
, Options
}

let Put =
{ Type =
{ chart : Text
, namespace : Optional Text
, create_namespace : Optional Bool
, release : Optional Text
, values : Optional Values
, override_values : Optional (List OverrideValue.Type)
, token_path : Optional Text
, version : Optional Text
, test : Optional Bool
, test_logs : Optional Bool
, delete : Optional Bool
, replace : Optional Bool
, force : Optional Bool
, devel : Optional Bool
, debug : Optional Bool
, check_is_ready : Optional Bool
, atomic : Optional Bool
, reuse_values : Optional Bool
, timeout : Optional Text
, wait : Optional Natural
, kubeconfig_path : Optional Text
, show_diff : Optional Bool
}
, default =
{ namespace = None Text
, create_namespace = None Bool
, release = None Text
, values = None Values
, override_values = None (List OverrideValue.Type)
, token_path = None Text
, version = None Text
, test = None Bool
, test_logs = None Bool
, delete = None Bool
, replace = None Bool
, force = None Bool
, devel = None Bool
, debug = None Bool
, check_is_ready = None Bool
, atomic = None Bool
, reuse_values = None Bool
, timeout = None Text
, wait = None Natural
, kubeconfig_path = None Text
, show_diff = None Bool
}
}

let test = Put::{ chart = "test" }

in Put
}
, Source =
let Plugin =
{ Type = { url : Text, version : Optional Text }
, default.version = None Text
}

let Repository =
{ Type =
{ name : Text
, url : Text
, username : Optional Text
, password : Optional Text
}
, default = { username = None Text, password = None Text }
}

let Source =
{ Type =
{ cluster_url : Optional Text
, cluster_ca : Optional Text
, insecure_cluster : Optional Bool
, token : Optional Text
, token_path : Optional Text
, admin_key : Optional Text
, admin_cert : Optional Text
, release : Optional Text
, namespace : Optional Text
, helm_history_max : Optional Natural
, repos : Optional (List Repository.Type)
, plugins : Optional (List Plugin.Type)
, stable_repo : Optional Text
, tracing_enabled : Optional Bool
, helm_setup_purge_all : Optional Bool
}
, default =
{ cluster_url = None Text
, cluster_ca = None Text
, insecure_cluster = None Bool
, token = None Text
, token_path = None Text
, admin_key = None Text
, admin_cert = None Text
, release = None Text
, namespace = None Text
, helm_history_max = None Natural
, repos = None (List Repository.Type)
, plugins = None (List Plugin.Type)
, stable_repo = None Text
, tracing_enabled = None Bool
, helm_setup_purge_all = None Bool
}
, Plugin
, Repository
}

let test = Source::{=}

in Source
}
3 changes: 3 additions & 0 deletions resource-types/package.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
, GithubRelease =
./GithubRelease.dhall sha256:1b782f3c5b49ccce426bb3364add8290aa83e267da5af95b5493ba2038f5ab36
? ./GithubRelease.dhall
, Helm3 =
./Helm3.dhall sha256:b105c98ee64027bc50deaea0951da2a8b235a43a5af3e9f4720bd2a57bda5474
? ./Helm3.dhall
, RegistryImage =
./RegistryImage.dhall sha256:2ca4df79f82f54275f919d759344a6478749f7d0f32bddbc0389877ede11da03
? ./RegistryImage.dhall
Expand Down

0 comments on commit 7077fbc

Please sign in to comment.