From af96b0bae143fd0d122219c61c1619f432c98c9b Mon Sep 17 00:00:00 2001 From: Ari Becker Date: Thu, 16 Jul 2020 09:11:44 +0300 Subject: [PATCH] Support Resource, ResourceType only (#5) * Support Resource, ResourceType only Drops the old, dormant implementation for a repository that focuses on hosting the types / schemas of the various resource types, and allows the downstream user to construct the type of their Resource and ResourceType as necessary. This solves the code-reusage problem while keeping downstream implementations performant. * Add Resource, ResourceType to top-level package --- README.md | 109 +++++------- Resource.dhall | 54 ++++++ ResourceType.dhall | 50 ++++++ legacy/README.md | 106 ++++++++++++ {default => legacy/default}/Job.dhall | 0 {default => legacy/default}/JobGroup.dhall | 0 {default => legacy/default}/Pipeline.dhall | 0 {default => legacy/default}/Resource.dhall | 0 .../default}/ResourceType.dhall | 0 .../default}/Step.Aggregate.dhall | 0 {default => legacy/default}/Step.Do.dhall | 0 {default => legacy/default}/Step.Get.dhall | 0 .../default}/Step.Hook.Step.Aggregate.dhall | 0 .../default}/Step.Hook.Step.Do.dhall | 0 .../default}/Step.Hook.Step.Get.dhall | 0 .../default}/Step.Hook.Step.Put.dhall | 0 .../Step.Hook.Step.Task.Config.Cache.dhall | 0 ...ask.Config.ImageResource.DockerImage.dhall | 0 ...k.Config.ImageResource.RegistryImage.dhall | 0 .../Step.Hook.Step.Task.Config.Input.dhall | 0 .../Step.Hook.Step.Task.Config.Output.dhall | 0 .../Step.Hook.Step.Task.Config.Run.dhall | 0 .../default}/Step.Hook.Step.Task.Config.dhall | 0 .../default}/Step.Hook.Step.Task.dhall | 0 .../default}/Step.Hook.Step.Try.dhall | 0 {default => legacy/default}/Step.Put.dhall | 0 .../default}/Step.Task.Config.Cache.dhall | 0 ...ask.Config.ImageResource.DockerImage.dhall | 0 ...k.Config.ImageResource.RegistryImage.dhall | 0 .../default}/Step.Task.Config.Input.dhall | 0 .../default}/Step.Task.Config.Output.dhall | 0 .../default}/Step.Task.Config.Run.dhall | 0 .../default}/Step.Task.Config.dhall | 0 {default => legacy/default}/Step.Task.dhall | 0 {default => legacy/default}/Step.Try.dhall | 0 {default => legacy/default}/Version.dhall | 0 {default => legacy/default}/package.dhall | 0 .../default}/resources/ChartMuseum.dhall | 0 .../resources/ConcoursePipeline.dhall | 0 .../default}/resources/DockerImage.dhall | 0 .../default}/resources/Git.dhall | 0 .../default}/resources/GithubListRepos.dhall | 0 .../default}/resources/GithubPR.dhall | 0 .../default}/resources/Helm.dhall | 0 .../default}/resources/RegistryImage.dhall | 0 .../default}/resources/S3.dhall | 0 .../default}/resources/S3Bucket.dhall | 0 .../default}/resources/Semver.dhall | 0 .../resources/SlackNotification.dhall | 0 .../default}/resources/package.dhall | 0 {types => legacy/types}/Job.dhall | 0 {types => legacy/types}/JobGroup.dhall | 0 {types => legacy/types}/Pipeline.dhall | 0 {types => legacy/types}/Resource.dhall | 0 {types => legacy/types}/ResourceType.dhall | 0 {types => legacy/types}/Step.Box.dhall | 0 {types => legacy/types}/Step.Get.dhall | 0 .../types}/Step.Hook.Step.Box.dhall | 0 .../types}/Step.Hook.Step.Get.dhall | 0 .../types}/Step.Hook.Step.Put.dhall | 0 .../Step.Hook.Step.Task.Config.Cache.dhall | 0 ....Hook.Step.Task.Config.ImageResource.dhall | 0 .../Step.Hook.Step.Task.Config.Input.dhall | 0 .../Step.Hook.Step.Task.Config.Output.dhall | 0 .../Step.Hook.Step.Task.Config.Run.dhall | 0 .../types}/Step.Hook.Step.Task.Config.dhall | 0 .../types}/Step.Hook.Step.Task.dhall | 0 {types => legacy/types}/Step.Hook.Step.dhall | 0 {types => legacy/types}/Step.Put.dhall | 0 .../types}/Step.Task.Config.Cache.dhall | 0 .../Step.Task.Config.ImageResource.dhall | 0 .../types}/Step.Task.Config.Input.dhall | 0 .../types}/Step.Task.Config.Output.dhall | 0 .../types}/Step.Task.Config.Run.dhall | 0 .../types}/Step.Task.Config.dhall | 0 {types => legacy/types}/Step.Task.dhall | 0 {types => legacy/types}/Step.dhall | 0 {types => legacy/types}/Version.dhall | 0 {types => legacy/types}/package.dhall | 0 .../types}/resources/ChartMuseum.dhall | 0 .../types}/resources/ConcoursePipeline.dhall | 0 .../types}/resources/DockerImage.dhall | 0 {types => legacy/types}/resources/Git.dhall | 0 .../types}/resources/GithubListRepos.dhall | 0 .../types}/resources/GithubPR.dhall | 0 {types => legacy/types}/resources/Helm.dhall | 0 .../types}/resources/RegistryImage.dhall | 0 {types => legacy/types}/resources/S3.dhall | 0 .../types}/resources/S3Bucket.dhall | 0 .../types}/resources/Semver.dhall | 0 .../types}/resources/SlackNotification.dhall | 0 .../types}/resources/_unions.dhall | 0 .../types}/resources/package.dhall | 0 package.dhall | 10 ++ resource-types/ConcoursePipeline.dhall | 77 +++++++++ resource-types/Dhall.dhall | 30 ++++ resource-types/DockerImage.dhall | 122 ++++++++++++++ resource-types/Git.dhall | 155 ++++++++++++++++++ resource-types/GitMultibranch.dhall | 89 ++++++++++ resource-types/GithubListRepos.dhall | 64 ++++++++ resource-types/GithubPR.dhall | 96 +++++++++++ resource-types/RegistryImage.dhall | 100 +++++++++++ resource-types/S3.dhall | 88 ++++++++++ resource-types/S3Bucket.dhall | 27 +++ resource-types/SlackNotification.dhall | 127 ++++++++++++++ resource-types/package.dhall | 34 ++++ 106 files changed, 1274 insertions(+), 64 deletions(-) create mode 100644 Resource.dhall create mode 100644 ResourceType.dhall create mode 100644 legacy/README.md rename {default => legacy/default}/Job.dhall (100%) rename {default => legacy/default}/JobGroup.dhall (100%) rename {default => legacy/default}/Pipeline.dhall (100%) rename {default => legacy/default}/Resource.dhall (100%) rename {default => legacy/default}/ResourceType.dhall (100%) rename {default => legacy/default}/Step.Aggregate.dhall (100%) rename {default => legacy/default}/Step.Do.dhall (100%) rename {default => legacy/default}/Step.Get.dhall (100%) rename {default => legacy/default}/Step.Hook.Step.Aggregate.dhall (100%) rename {default => legacy/default}/Step.Hook.Step.Do.dhall (100%) rename {default => legacy/default}/Step.Hook.Step.Get.dhall (100%) rename {default => legacy/default}/Step.Hook.Step.Put.dhall (100%) rename {default => legacy/default}/Step.Hook.Step.Task.Config.Cache.dhall (100%) rename {default => legacy/default}/Step.Hook.Step.Task.Config.ImageResource.DockerImage.dhall (100%) rename {default => legacy/default}/Step.Hook.Step.Task.Config.ImageResource.RegistryImage.dhall (100%) rename {default => legacy/default}/Step.Hook.Step.Task.Config.Input.dhall (100%) rename {default => legacy/default}/Step.Hook.Step.Task.Config.Output.dhall (100%) rename {default => legacy/default}/Step.Hook.Step.Task.Config.Run.dhall (100%) rename {default => legacy/default}/Step.Hook.Step.Task.Config.dhall (100%) rename {default => legacy/default}/Step.Hook.Step.Task.dhall (100%) rename {default => legacy/default}/Step.Hook.Step.Try.dhall (100%) rename {default => legacy/default}/Step.Put.dhall (100%) rename {default => legacy/default}/Step.Task.Config.Cache.dhall (100%) rename {default => legacy/default}/Step.Task.Config.ImageResource.DockerImage.dhall (100%) rename {default => legacy/default}/Step.Task.Config.ImageResource.RegistryImage.dhall (100%) rename {default => legacy/default}/Step.Task.Config.Input.dhall (100%) rename {default => legacy/default}/Step.Task.Config.Output.dhall (100%) rename {default => legacy/default}/Step.Task.Config.Run.dhall (100%) rename {default => legacy/default}/Step.Task.Config.dhall (100%) rename {default => legacy/default}/Step.Task.dhall (100%) rename {default => legacy/default}/Step.Try.dhall (100%) rename {default => legacy/default}/Version.dhall (100%) rename {default => legacy/default}/package.dhall (100%) rename {default => legacy/default}/resources/ChartMuseum.dhall (100%) rename {default => legacy/default}/resources/ConcoursePipeline.dhall (100%) rename {default => legacy/default}/resources/DockerImage.dhall (100%) rename {default => legacy/default}/resources/Git.dhall (100%) rename {default => legacy/default}/resources/GithubListRepos.dhall (100%) rename {default => legacy/default}/resources/GithubPR.dhall (100%) rename {default => legacy/default}/resources/Helm.dhall (100%) rename {default => legacy/default}/resources/RegistryImage.dhall (100%) rename {default => legacy/default}/resources/S3.dhall (100%) rename {default => legacy/default}/resources/S3Bucket.dhall (100%) rename {default => legacy/default}/resources/Semver.dhall (100%) rename {default => legacy/default}/resources/SlackNotification.dhall (100%) rename {default => legacy/default}/resources/package.dhall (100%) rename {types => legacy/types}/Job.dhall (100%) rename {types => legacy/types}/JobGroup.dhall (100%) rename {types => legacy/types}/Pipeline.dhall (100%) rename {types => legacy/types}/Resource.dhall (100%) rename {types => legacy/types}/ResourceType.dhall (100%) rename {types => legacy/types}/Step.Box.dhall (100%) rename {types => legacy/types}/Step.Get.dhall (100%) rename {types => legacy/types}/Step.Hook.Step.Box.dhall (100%) rename {types => legacy/types}/Step.Hook.Step.Get.dhall (100%) rename {types => legacy/types}/Step.Hook.Step.Put.dhall (100%) rename {types => legacy/types}/Step.Hook.Step.Task.Config.Cache.dhall (100%) rename {types => legacy/types}/Step.Hook.Step.Task.Config.ImageResource.dhall (100%) rename {types => legacy/types}/Step.Hook.Step.Task.Config.Input.dhall (100%) rename {types => legacy/types}/Step.Hook.Step.Task.Config.Output.dhall (100%) rename {types => legacy/types}/Step.Hook.Step.Task.Config.Run.dhall (100%) rename {types => legacy/types}/Step.Hook.Step.Task.Config.dhall (100%) rename {types => legacy/types}/Step.Hook.Step.Task.dhall (100%) rename {types => legacy/types}/Step.Hook.Step.dhall (100%) rename {types => legacy/types}/Step.Put.dhall (100%) rename {types => legacy/types}/Step.Task.Config.Cache.dhall (100%) rename {types => legacy/types}/Step.Task.Config.ImageResource.dhall (100%) rename {types => legacy/types}/Step.Task.Config.Input.dhall (100%) rename {types => legacy/types}/Step.Task.Config.Output.dhall (100%) rename {types => legacy/types}/Step.Task.Config.Run.dhall (100%) rename {types => legacy/types}/Step.Task.Config.dhall (100%) rename {types => legacy/types}/Step.Task.dhall (100%) rename {types => legacy/types}/Step.dhall (100%) rename {types => legacy/types}/Version.dhall (100%) rename {types => legacy/types}/package.dhall (100%) rename {types => legacy/types}/resources/ChartMuseum.dhall (100%) rename {types => legacy/types}/resources/ConcoursePipeline.dhall (100%) rename {types => legacy/types}/resources/DockerImage.dhall (100%) rename {types => legacy/types}/resources/Git.dhall (100%) rename {types => legacy/types}/resources/GithubListRepos.dhall (100%) rename {types => legacy/types}/resources/GithubPR.dhall (100%) rename {types => legacy/types}/resources/Helm.dhall (100%) rename {types => legacy/types}/resources/RegistryImage.dhall (100%) rename {types => legacy/types}/resources/S3.dhall (100%) rename {types => legacy/types}/resources/S3Bucket.dhall (100%) rename {types => legacy/types}/resources/Semver.dhall (100%) rename {types => legacy/types}/resources/SlackNotification.dhall (100%) rename {types => legacy/types}/resources/_unions.dhall (100%) rename {types => legacy/types}/resources/package.dhall (100%) create mode 100644 package.dhall create mode 100644 resource-types/ConcoursePipeline.dhall create mode 100644 resource-types/Dhall.dhall create mode 100644 resource-types/DockerImage.dhall create mode 100644 resource-types/Git.dhall create mode 100644 resource-types/GitMultibranch.dhall create mode 100644 resource-types/GithubListRepos.dhall create mode 100644 resource-types/GithubPR.dhall create mode 100644 resource-types/RegistryImage.dhall create mode 100644 resource-types/S3.dhall create mode 100644 resource-types/S3Bucket.dhall create mode 100644 resource-types/SlackNotification.dhall create mode 100644 resource-types/package.dhall diff --git a/README.md b/README.md index e076ae5..5f796c6 100644 --- a/README.md +++ b/README.md @@ -1,98 +1,79 @@ # dhall-concourse -[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme) - > Dhall types for Concourse -## Notice -This project is currently dormant. +## Historical Notice +This project now contains only the types used by various resource types used in Concourse pipelines. It used to attempt to cover the entire domain of Concourse pipelines, including steps. That work is currently dormant, and is archived under `legacy/`. -Expanding the domain supported by `dhall-concourse` has caused performance to become unbearably slow and expensive. For non-trivial pipelines, parsing times are reaching 40+ minutes and can consume 10+ GB of memory. The slow and expensive performance is due to the increasing numbers of deeply-nested unions being added to the model, and currently, large nested unions are not handled performantly by the Haskell reference implementation. +Expanding the domain supported by `dhall-concourse` caused performance to become unbearably slow and expensive. For non-trivial pipelines, parsing times reached 40+ minutes and could consume 10+ GB of memory. The slow and expensive performance was due to the increasing numbers of deeply-nested unions being added to the model, and currently, large nested unions are not handled performantly by the Haskell reference implementation. At such time as a Dhall implementation will mature to the point where working with the model becomes performant, work will resume on this project. ## Description -This repository includes types, default records, and functions that produce default records in the [Dhall language](https://github.com/dhall-lang/dhall-lang) which model the Concourse CI pipeline domain. They are based off the [Concourse CI documentation reference](https://concourse-ci.org/pipelines.html). +This repository includes [Dhall](https://github.com/dhall-lang/dhall-lang) schemas which model various resource types in the Concourse CI pipeline domain, which is documented in the [Concourse CI documentation reference](https://concourse-ci.org/pipelines.html). This allows the user to more easily generate type-safe Concourse CI pipelines, through the use of the Dhall project's `dhall-to-yaml` tool. -### Limitations -* Various step modifiers have not yet been incorporated into the model: `tags`, `timeout`, and `attempts`. -* Resources need to be added to the project to be usable. From the benefit of experience of the maintainers, this seems to ultimately be the result of Dhall not (yet) supporting dependent types, and cannot be worked around at this time without losing type safety for each Resource's source, get parameters, and put parameters' types. As a result, this project violates Concourse's [`contributor-burden`](https://github.com/concourse/concourse/wiki/Anti-Patterns#contributor-burden) anti-pattern, and is unlikely to become an official Concourse project. Users who wish to use resources not included in the project are encouraged to open pull requests. -* The Concourse pipeline models `Step`s as recursive types, as each `Step` record has fields `on_success`, `on_failure`, `on_abort`, and `ensure` of type `Step`. While there is an official [guide](https://github.com/dhall-lang/dhall-lang/wiki/How-to-translate-recursive-code-to-Dhall) that documents a strategy for implementing a recursive type within Dhall's restrictions, currently `dhall-concourse` does not adopt that strategy. Instead, a `Step` has fields of type `StepHook`, and `StepHook`s do not have recursive fields. For the time being, this addresses most use cases while presenting a more-easily addressable API to the user. The project is open to pull requests that offer an additional level of recursion, and may adopt the official strategy for transforming recursive code in the future. -* There is limited support for the `aggregate`, `do`, and `try` steps. They may be used as "parent steps" for `get`, `put`, and `task` steps under a Job's plan, and under the `on_success`, `on_failure`, `on_abort`, and `ensure` step hooks. Structures like an `aggregate` step having a list of `try` steps is not currently supported, and it is not likely that support for such structures will be introduced until a solution can be found for introducing a recursive step model into the types. - ### Supported Resources -* ChartMuseum - [`cathive/concourse-chartmuseum-resource`](https://github.com/cathive/concourse-chartmuseum-resource) * Concourse Pipeline - [`concourse/concourse-pipeline-resource`](https://github.com/concourse/concourse-pipeline-resource) +* Dhall - [`coralogix/eng-concourse-resource-dhall`](https://github.com/coralogix/eng-concourse-resource-dhall) * Docker Image - [`concourse/docker-image-resource`](https://github.com/concourse/docker-image-resource) * Git - [`concourse/git-resource`](https://github.com/concourse/git-resource) * Github List Repos - [`coralogix/eng-concourse-resource-github-list-repos`](https://github.com/coralogix/eng-concourse-resource-github-list-repos) * Github PR - [`telia-oss/github-pr-resource`](https://github.com/telia-oss/github-pr-resource) -* Helm - [`linkyard/concourse-helm-resource`](https://github.com/linkyard/concourse-helm-resource) +* Git Multibranch - [`cloudfoundry-community/git-multibranch-resource`](https://github.com/cloudfoundry-community/git-multibranch-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) -* Semver - [`concourse/semver-resource`](https://github.com/concourse/semver-resource) * Slack Notification - [`cloudfoundry-community/slack-notification-resource`](https://github.com/cloudfoundry-community/slack-notification-resource) ## Install For stability, users are encouraged to import from a tagged release, not from the master branch, and to watch for new releases. This project does not yet have rigorous testing set up for it and new commits on the master branch are prone to break compatibility and are almost sure to change the import hash for the expression, thus the releases are currently `v0.x`. +To import everything, use: ``` -https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.3.0/default/package.dhall sha256:8908ad8da681c45af47accf601124608b68c7b08a18795bca579f94161acf3a4 -https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.3.0/types/package.dhall sha256:f45ad5ca29b957eb028b3d7bbb24da2e63ec79cbab5c2042292f7178ec08c6d5 +https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.4.0/package.dhall sha256:a82cb4bdc359bdea12fde89119c6c3e64ccae1392c716106743b9a8a9eb04b4f ``` -## Usage -For example - generating the documentation's smallest pipeline example: +## Intended Usage + +The Concourse pipeline schema requires that every `resource_type`, `resource`, `get` step, etc. are exactly the same - except for their `source` and `params` fields, whose contents depend on which resource type is being referred to. The naive way to represent this (for example, for a resource) in Dhall is by writing: + ```dhall --- hello-world-pipeline.dhall - -let Concourse = - https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.3.0/default/package.dhall sha256:8908ad8da681c45af47accf601124608b68c7b08a18795bca579f94161acf3a4 - -let ConcourseTypes = - https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.3.0/types/package.dhall sha256:f45ad5ca29b957eb028b3d7bbb24da2e63ec79cbab5c2042292f7178ec08c6d5 - -in Concourse.Pipeline - { jobs = - [ Concourse.Job - { name = - "hello-world" - , plan = - [ ConcourseTypes.StepBox.Task - ( Concourse.Task - { task = "say-hello" } - ⫽ { config = - Some - ( Concourse.TaskConfig - { platform = - "linux" - , run = - Concourse.TaskConfigRun { path = "echo" } - ⫽ { args = Some [ "Hello, world!" ] } - } - ⫽ { image_resource = - Some - ( ConcourseTypes.TaskConfigImageResource.schema.DockerImage - ( Concourse.TaskConfigDockerImageResource - { repository = "alpine" } - ) - ) - } - ) - } - ) - ] - } - ] - } +let Resource = + { name : Text + , type : Text + , source : ? + -- other fields + } +in Resource ``` -### CLI -```bash -dhall-to-yaml --omitNull <<< './hello-world-pipeline.dhall' > hello-world-pipeline.yaml -fly -t main set-pipeline -p hello-world -c ./hello-world-pipeline.yaml + +This introduces a question - what should the type of the `source` field be? Maintaining the union of all of the possibilities of the `source` field becomes tedious. But putting a union of every possible alternative, of every possible resource type in existence, would make the resulting normal form too large to be performant (even if it were possible to maintain them all in a single repository). + +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.4.0/resource-types/Git.dhall sha256:830b9d7d0e9e0992ee2473f78e05838a86be3e13c7bcf5df661b8829dbc3d558 + +let S3 = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.4.0/resource-types/S3.dhall sha256:6e062defd2cf94a3f7840d1b09c7a832d0a92467f5924a2b812843c053a8eca5 + +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.4.0/Resource.dhall sha256:206f784b14f3fb78809bafffbde955fbc177ca0427c8fe9cf4a983a8aaf463c1 + + in import { Source, Version } + +in Resource::{ + , name = "example-repository" + , type = Git.meta.name + , source = + Source.Git + Git.Source::{ uri = "git@github.com:example/example.git" } + } ``` ## Maintainers diff --git a/Resource.dhall b/Resource.dhall new file mode 100644 index 0000000..9b2830e --- /dev/null +++ b/Resource.dhall @@ -0,0 +1,54 @@ +let Resource + : ∀(_params : { Source : Type, Version : Type }) → + { Type : Type + , default : + { icon : Optional Text + , version : Optional _params.Version + , check_every : Optional Text + , tags : Optional (List Text) + , public : Optional Bool + , webhook_token : Optional Text + } + } + = λ(_params : { Source : Type, Version : Type }) → + { Type = + { name : Text + , type : Text + , source : _params.Source + , icon : Optional Text + , version : Optional _params.Version + , check_every : Optional Text + , tags : Optional (List Text) + , public : Optional Bool + , webhook_token : Optional Text + } + , default = + { icon = None Text + , version = None _params.Version + , check_every = None Text + , tags = None (List Text) + , public = None Bool + , webhook_token = None Text + } + } + +let example = + let Git = ./resource-types/Git.dhall + + let S3 = ./resource-types/S3.dhall + + let Source = < Git : Git.Source.Type | S3 : S3.Source.Type > + + let Version = < Git : Git.Version.Type | S3 : S3.Version.Type > + + let Resource = Resource { Source, Version } + + in Resource::{ + , name = "example-repository" + , type = Git.meta.name + , source = + Source.Git + Git.Source::{ uri = "git@github.com:example/example.git" } + } + +in Resource diff --git a/ResourceType.dhall b/ResourceType.dhall new file mode 100644 index 0000000..2b27c28 --- /dev/null +++ b/ResourceType.dhall @@ -0,0 +1,50 @@ +let ResourceType + : ∀(_params : { Source : Type, SourceGetParams : Type }) → + { Type : Type + , default : + { privileged : Optional Bool + , params : Optional _params.SourceGetParams + , check_every : Optional Text + , tags : Optional (List Text) + , unique_version_history : Optional Bool + } + } + = λ(_params : { Source : Type, SourceGetParams : Type }) → + { Type = + { name : Text + , type : Text + , source : _params.Source + , privileged : Optional Bool + , params : Optional _params.SourceGetParams + , check_every : Optional Text + , tags : Optional (List Text) + , unique_version_history : Optional Bool + } + , default = + { privileged = None Bool + , params = None _params.SourceGetParams + , check_every = None Text + , tags = None (List Text) + , unique_version_history = None Bool + } + } + +let example = + let RegistryImage = ./resource-types/RegistryImage.dhall + + let GithubListRepos = ./resource-types/GithubListRepos.dhall + + let Source = RegistryImage.Source.Type + + let SourceGetParams = RegistryImage.Params.Get.Type + + let ResourceType = ResourceType { Source, SourceGetParams } + + in ResourceType::{ + , name = GithubListRepos.meta.name + , type = RegistryImage.meta.name + , source = RegistryImage.Source::GithubListRepos.meta.{ repository } + , params = Some RegistryImage.Params.Get::{ format = Some "rootfs" } + } + +in ResourceType diff --git a/legacy/README.md b/legacy/README.md new file mode 100644 index 0000000..e076ae5 --- /dev/null +++ b/legacy/README.md @@ -0,0 +1,106 @@ +# dhall-concourse + +[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme) + +> Dhall types for Concourse + +## Notice +This project is currently dormant. + +Expanding the domain supported by `dhall-concourse` has caused performance to become unbearably slow and expensive. For non-trivial pipelines, parsing times are reaching 40+ minutes and can consume 10+ GB of memory. The slow and expensive performance is due to the increasing numbers of deeply-nested unions being added to the model, and currently, large nested unions are not handled performantly by the Haskell reference implementation. + +At such time as a Dhall implementation will mature to the point where working with the model becomes performant, work will resume on this project. + +## Description + +This repository includes types, default records, and functions that produce default records in the [Dhall language](https://github.com/dhall-lang/dhall-lang) which model the Concourse CI pipeline domain. They are based off the [Concourse CI documentation reference](https://concourse-ci.org/pipelines.html). + +This allows the user to more easily generate type-safe Concourse CI pipelines, through the use of the Dhall project's `dhall-to-yaml` tool. + +### Limitations +* Various step modifiers have not yet been incorporated into the model: `tags`, `timeout`, and `attempts`. +* Resources need to be added to the project to be usable. From the benefit of experience of the maintainers, this seems to ultimately be the result of Dhall not (yet) supporting dependent types, and cannot be worked around at this time without losing type safety for each Resource's source, get parameters, and put parameters' types. As a result, this project violates Concourse's [`contributor-burden`](https://github.com/concourse/concourse/wiki/Anti-Patterns#contributor-burden) anti-pattern, and is unlikely to become an official Concourse project. Users who wish to use resources not included in the project are encouraged to open pull requests. +* The Concourse pipeline models `Step`s as recursive types, as each `Step` record has fields `on_success`, `on_failure`, `on_abort`, and `ensure` of type `Step`. While there is an official [guide](https://github.com/dhall-lang/dhall-lang/wiki/How-to-translate-recursive-code-to-Dhall) that documents a strategy for implementing a recursive type within Dhall's restrictions, currently `dhall-concourse` does not adopt that strategy. Instead, a `Step` has fields of type `StepHook`, and `StepHook`s do not have recursive fields. For the time being, this addresses most use cases while presenting a more-easily addressable API to the user. The project is open to pull requests that offer an additional level of recursion, and may adopt the official strategy for transforming recursive code in the future. +* There is limited support for the `aggregate`, `do`, and `try` steps. They may be used as "parent steps" for `get`, `put`, and `task` steps under a Job's plan, and under the `on_success`, `on_failure`, `on_abort`, and `ensure` step hooks. Structures like an `aggregate` step having a list of `try` steps is not currently supported, and it is not likely that support for such structures will be introduced until a solution can be found for introducing a recursive step model into the types. + +### Supported Resources +* ChartMuseum - [`cathive/concourse-chartmuseum-resource`](https://github.com/cathive/concourse-chartmuseum-resource) +* Concourse Pipeline - [`concourse/concourse-pipeline-resource`](https://github.com/concourse/concourse-pipeline-resource) +* Docker Image - [`concourse/docker-image-resource`](https://github.com/concourse/docker-image-resource) +* Git - [`concourse/git-resource`](https://github.com/concourse/git-resource) +* Github List Repos - [`coralogix/eng-concourse-resource-github-list-repos`](https://github.com/coralogix/eng-concourse-resource-github-list-repos) +* Github PR - [`telia-oss/github-pr-resource`](https://github.com/telia-oss/github-pr-resource) +* Helm - [`linkyard/concourse-helm-resource`](https://github.com/linkyard/concourse-helm-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) +* Semver - [`concourse/semver-resource`](https://github.com/concourse/semver-resource) +* Slack Notification - [`cloudfoundry-community/slack-notification-resource`](https://github.com/cloudfoundry-community/slack-notification-resource) + +## Install +For stability, users are encouraged to import from a tagged release, not from the master branch, and to watch for new releases. This project does not yet have rigorous testing set up for it and new commits on the master branch are prone to break compatibility and are almost sure to change the import hash for the expression, thus the releases are currently `v0.x`. +``` +https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.3.0/default/package.dhall sha256:8908ad8da681c45af47accf601124608b68c7b08a18795bca579f94161acf3a4 +https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.3.0/types/package.dhall sha256:f45ad5ca29b957eb028b3d7bbb24da2e63ec79cbab5c2042292f7178ec08c6d5 +``` + +## Usage +For example - generating the documentation's smallest pipeline example: +```dhall +-- hello-world-pipeline.dhall + +let Concourse = + https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.3.0/default/package.dhall sha256:8908ad8da681c45af47accf601124608b68c7b08a18795bca579f94161acf3a4 + +let ConcourseTypes = + https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.3.0/types/package.dhall sha256:f45ad5ca29b957eb028b3d7bbb24da2e63ec79cbab5c2042292f7178ec08c6d5 + +in Concourse.Pipeline + { jobs = + [ Concourse.Job + { name = + "hello-world" + , plan = + [ ConcourseTypes.StepBox.Task + ( Concourse.Task + { task = "say-hello" } + ⫽ { config = + Some + ( Concourse.TaskConfig + { platform = + "linux" + , run = + Concourse.TaskConfigRun { path = "echo" } + ⫽ { args = Some [ "Hello, world!" ] } + } + ⫽ { image_resource = + Some + ( ConcourseTypes.TaskConfigImageResource.schema.DockerImage + ( Concourse.TaskConfigDockerImageResource + { repository = "alpine" } + ) + ) + } + ) + } + ) + ] + } + ] + } +``` +### CLI +```bash +dhall-to-yaml --omitNull <<< './hello-world-pipeline.dhall' > hello-world-pipeline.yaml +fly -t main set-pipeline -p hello-world -c ./hello-world-pipeline.yaml +``` + +## Maintainers +[Ari Becker](https://github.com/ari-becker) +[Oded David](https://github.com/oded-dd) + +## Contributing +TBD + +## License +[Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0) © Coralogix, Inc. diff --git a/default/Job.dhall b/legacy/default/Job.dhall similarity index 100% rename from default/Job.dhall rename to legacy/default/Job.dhall diff --git a/default/JobGroup.dhall b/legacy/default/JobGroup.dhall similarity index 100% rename from default/JobGroup.dhall rename to legacy/default/JobGroup.dhall diff --git a/default/Pipeline.dhall b/legacy/default/Pipeline.dhall similarity index 100% rename from default/Pipeline.dhall rename to legacy/default/Pipeline.dhall diff --git a/default/Resource.dhall b/legacy/default/Resource.dhall similarity index 100% rename from default/Resource.dhall rename to legacy/default/Resource.dhall diff --git a/default/ResourceType.dhall b/legacy/default/ResourceType.dhall similarity index 100% rename from default/ResourceType.dhall rename to legacy/default/ResourceType.dhall diff --git a/default/Step.Aggregate.dhall b/legacy/default/Step.Aggregate.dhall similarity index 100% rename from default/Step.Aggregate.dhall rename to legacy/default/Step.Aggregate.dhall diff --git a/default/Step.Do.dhall b/legacy/default/Step.Do.dhall similarity index 100% rename from default/Step.Do.dhall rename to legacy/default/Step.Do.dhall diff --git a/default/Step.Get.dhall b/legacy/default/Step.Get.dhall similarity index 100% rename from default/Step.Get.dhall rename to legacy/default/Step.Get.dhall diff --git a/default/Step.Hook.Step.Aggregate.dhall b/legacy/default/Step.Hook.Step.Aggregate.dhall similarity index 100% rename from default/Step.Hook.Step.Aggregate.dhall rename to legacy/default/Step.Hook.Step.Aggregate.dhall diff --git a/default/Step.Hook.Step.Do.dhall b/legacy/default/Step.Hook.Step.Do.dhall similarity index 100% rename from default/Step.Hook.Step.Do.dhall rename to legacy/default/Step.Hook.Step.Do.dhall diff --git a/default/Step.Hook.Step.Get.dhall b/legacy/default/Step.Hook.Step.Get.dhall similarity index 100% rename from default/Step.Hook.Step.Get.dhall rename to legacy/default/Step.Hook.Step.Get.dhall diff --git a/default/Step.Hook.Step.Put.dhall b/legacy/default/Step.Hook.Step.Put.dhall similarity index 100% rename from default/Step.Hook.Step.Put.dhall rename to legacy/default/Step.Hook.Step.Put.dhall diff --git a/default/Step.Hook.Step.Task.Config.Cache.dhall b/legacy/default/Step.Hook.Step.Task.Config.Cache.dhall similarity index 100% rename from default/Step.Hook.Step.Task.Config.Cache.dhall rename to legacy/default/Step.Hook.Step.Task.Config.Cache.dhall diff --git a/default/Step.Hook.Step.Task.Config.ImageResource.DockerImage.dhall b/legacy/default/Step.Hook.Step.Task.Config.ImageResource.DockerImage.dhall similarity index 100% rename from default/Step.Hook.Step.Task.Config.ImageResource.DockerImage.dhall rename to legacy/default/Step.Hook.Step.Task.Config.ImageResource.DockerImage.dhall diff --git a/default/Step.Hook.Step.Task.Config.ImageResource.RegistryImage.dhall b/legacy/default/Step.Hook.Step.Task.Config.ImageResource.RegistryImage.dhall similarity index 100% rename from default/Step.Hook.Step.Task.Config.ImageResource.RegistryImage.dhall rename to legacy/default/Step.Hook.Step.Task.Config.ImageResource.RegistryImage.dhall diff --git a/default/Step.Hook.Step.Task.Config.Input.dhall b/legacy/default/Step.Hook.Step.Task.Config.Input.dhall similarity index 100% rename from default/Step.Hook.Step.Task.Config.Input.dhall rename to legacy/default/Step.Hook.Step.Task.Config.Input.dhall diff --git a/default/Step.Hook.Step.Task.Config.Output.dhall b/legacy/default/Step.Hook.Step.Task.Config.Output.dhall similarity index 100% rename from default/Step.Hook.Step.Task.Config.Output.dhall rename to legacy/default/Step.Hook.Step.Task.Config.Output.dhall diff --git a/default/Step.Hook.Step.Task.Config.Run.dhall b/legacy/default/Step.Hook.Step.Task.Config.Run.dhall similarity index 100% rename from default/Step.Hook.Step.Task.Config.Run.dhall rename to legacy/default/Step.Hook.Step.Task.Config.Run.dhall diff --git a/default/Step.Hook.Step.Task.Config.dhall b/legacy/default/Step.Hook.Step.Task.Config.dhall similarity index 100% rename from default/Step.Hook.Step.Task.Config.dhall rename to legacy/default/Step.Hook.Step.Task.Config.dhall diff --git a/default/Step.Hook.Step.Task.dhall b/legacy/default/Step.Hook.Step.Task.dhall similarity index 100% rename from default/Step.Hook.Step.Task.dhall rename to legacy/default/Step.Hook.Step.Task.dhall diff --git a/default/Step.Hook.Step.Try.dhall b/legacy/default/Step.Hook.Step.Try.dhall similarity index 100% rename from default/Step.Hook.Step.Try.dhall rename to legacy/default/Step.Hook.Step.Try.dhall diff --git a/default/Step.Put.dhall b/legacy/default/Step.Put.dhall similarity index 100% rename from default/Step.Put.dhall rename to legacy/default/Step.Put.dhall diff --git a/default/Step.Task.Config.Cache.dhall b/legacy/default/Step.Task.Config.Cache.dhall similarity index 100% rename from default/Step.Task.Config.Cache.dhall rename to legacy/default/Step.Task.Config.Cache.dhall diff --git a/default/Step.Task.Config.ImageResource.DockerImage.dhall b/legacy/default/Step.Task.Config.ImageResource.DockerImage.dhall similarity index 100% rename from default/Step.Task.Config.ImageResource.DockerImage.dhall rename to legacy/default/Step.Task.Config.ImageResource.DockerImage.dhall diff --git a/default/Step.Task.Config.ImageResource.RegistryImage.dhall b/legacy/default/Step.Task.Config.ImageResource.RegistryImage.dhall similarity index 100% rename from default/Step.Task.Config.ImageResource.RegistryImage.dhall rename to legacy/default/Step.Task.Config.ImageResource.RegistryImage.dhall diff --git a/default/Step.Task.Config.Input.dhall b/legacy/default/Step.Task.Config.Input.dhall similarity index 100% rename from default/Step.Task.Config.Input.dhall rename to legacy/default/Step.Task.Config.Input.dhall diff --git a/default/Step.Task.Config.Output.dhall b/legacy/default/Step.Task.Config.Output.dhall similarity index 100% rename from default/Step.Task.Config.Output.dhall rename to legacy/default/Step.Task.Config.Output.dhall diff --git a/default/Step.Task.Config.Run.dhall b/legacy/default/Step.Task.Config.Run.dhall similarity index 100% rename from default/Step.Task.Config.Run.dhall rename to legacy/default/Step.Task.Config.Run.dhall diff --git a/default/Step.Task.Config.dhall b/legacy/default/Step.Task.Config.dhall similarity index 100% rename from default/Step.Task.Config.dhall rename to legacy/default/Step.Task.Config.dhall diff --git a/default/Step.Task.dhall b/legacy/default/Step.Task.dhall similarity index 100% rename from default/Step.Task.dhall rename to legacy/default/Step.Task.dhall diff --git a/default/Step.Try.dhall b/legacy/default/Step.Try.dhall similarity index 100% rename from default/Step.Try.dhall rename to legacy/default/Step.Try.dhall diff --git a/default/Version.dhall b/legacy/default/Version.dhall similarity index 100% rename from default/Version.dhall rename to legacy/default/Version.dhall diff --git a/default/package.dhall b/legacy/default/package.dhall similarity index 100% rename from default/package.dhall rename to legacy/default/package.dhall diff --git a/default/resources/ChartMuseum.dhall b/legacy/default/resources/ChartMuseum.dhall similarity index 100% rename from default/resources/ChartMuseum.dhall rename to legacy/default/resources/ChartMuseum.dhall diff --git a/default/resources/ConcoursePipeline.dhall b/legacy/default/resources/ConcoursePipeline.dhall similarity index 100% rename from default/resources/ConcoursePipeline.dhall rename to legacy/default/resources/ConcoursePipeline.dhall diff --git a/default/resources/DockerImage.dhall b/legacy/default/resources/DockerImage.dhall similarity index 100% rename from default/resources/DockerImage.dhall rename to legacy/default/resources/DockerImage.dhall diff --git a/default/resources/Git.dhall b/legacy/default/resources/Git.dhall similarity index 100% rename from default/resources/Git.dhall rename to legacy/default/resources/Git.dhall diff --git a/default/resources/GithubListRepos.dhall b/legacy/default/resources/GithubListRepos.dhall similarity index 100% rename from default/resources/GithubListRepos.dhall rename to legacy/default/resources/GithubListRepos.dhall diff --git a/default/resources/GithubPR.dhall b/legacy/default/resources/GithubPR.dhall similarity index 100% rename from default/resources/GithubPR.dhall rename to legacy/default/resources/GithubPR.dhall diff --git a/default/resources/Helm.dhall b/legacy/default/resources/Helm.dhall similarity index 100% rename from default/resources/Helm.dhall rename to legacy/default/resources/Helm.dhall diff --git a/default/resources/RegistryImage.dhall b/legacy/default/resources/RegistryImage.dhall similarity index 100% rename from default/resources/RegistryImage.dhall rename to legacy/default/resources/RegistryImage.dhall diff --git a/default/resources/S3.dhall b/legacy/default/resources/S3.dhall similarity index 100% rename from default/resources/S3.dhall rename to legacy/default/resources/S3.dhall diff --git a/default/resources/S3Bucket.dhall b/legacy/default/resources/S3Bucket.dhall similarity index 100% rename from default/resources/S3Bucket.dhall rename to legacy/default/resources/S3Bucket.dhall diff --git a/default/resources/Semver.dhall b/legacy/default/resources/Semver.dhall similarity index 100% rename from default/resources/Semver.dhall rename to legacy/default/resources/Semver.dhall diff --git a/default/resources/SlackNotification.dhall b/legacy/default/resources/SlackNotification.dhall similarity index 100% rename from default/resources/SlackNotification.dhall rename to legacy/default/resources/SlackNotification.dhall diff --git a/default/resources/package.dhall b/legacy/default/resources/package.dhall similarity index 100% rename from default/resources/package.dhall rename to legacy/default/resources/package.dhall diff --git a/types/Job.dhall b/legacy/types/Job.dhall similarity index 100% rename from types/Job.dhall rename to legacy/types/Job.dhall diff --git a/types/JobGroup.dhall b/legacy/types/JobGroup.dhall similarity index 100% rename from types/JobGroup.dhall rename to legacy/types/JobGroup.dhall diff --git a/types/Pipeline.dhall b/legacy/types/Pipeline.dhall similarity index 100% rename from types/Pipeline.dhall rename to legacy/types/Pipeline.dhall diff --git a/types/Resource.dhall b/legacy/types/Resource.dhall similarity index 100% rename from types/Resource.dhall rename to legacy/types/Resource.dhall diff --git a/types/ResourceType.dhall b/legacy/types/ResourceType.dhall similarity index 100% rename from types/ResourceType.dhall rename to legacy/types/ResourceType.dhall diff --git a/types/Step.Box.dhall b/legacy/types/Step.Box.dhall similarity index 100% rename from types/Step.Box.dhall rename to legacy/types/Step.Box.dhall diff --git a/types/Step.Get.dhall b/legacy/types/Step.Get.dhall similarity index 100% rename from types/Step.Get.dhall rename to legacy/types/Step.Get.dhall diff --git a/types/Step.Hook.Step.Box.dhall b/legacy/types/Step.Hook.Step.Box.dhall similarity index 100% rename from types/Step.Hook.Step.Box.dhall rename to legacy/types/Step.Hook.Step.Box.dhall diff --git a/types/Step.Hook.Step.Get.dhall b/legacy/types/Step.Hook.Step.Get.dhall similarity index 100% rename from types/Step.Hook.Step.Get.dhall rename to legacy/types/Step.Hook.Step.Get.dhall diff --git a/types/Step.Hook.Step.Put.dhall b/legacy/types/Step.Hook.Step.Put.dhall similarity index 100% rename from types/Step.Hook.Step.Put.dhall rename to legacy/types/Step.Hook.Step.Put.dhall diff --git a/types/Step.Hook.Step.Task.Config.Cache.dhall b/legacy/types/Step.Hook.Step.Task.Config.Cache.dhall similarity index 100% rename from types/Step.Hook.Step.Task.Config.Cache.dhall rename to legacy/types/Step.Hook.Step.Task.Config.Cache.dhall diff --git a/types/Step.Hook.Step.Task.Config.ImageResource.dhall b/legacy/types/Step.Hook.Step.Task.Config.ImageResource.dhall similarity index 100% rename from types/Step.Hook.Step.Task.Config.ImageResource.dhall rename to legacy/types/Step.Hook.Step.Task.Config.ImageResource.dhall diff --git a/types/Step.Hook.Step.Task.Config.Input.dhall b/legacy/types/Step.Hook.Step.Task.Config.Input.dhall similarity index 100% rename from types/Step.Hook.Step.Task.Config.Input.dhall rename to legacy/types/Step.Hook.Step.Task.Config.Input.dhall diff --git a/types/Step.Hook.Step.Task.Config.Output.dhall b/legacy/types/Step.Hook.Step.Task.Config.Output.dhall similarity index 100% rename from types/Step.Hook.Step.Task.Config.Output.dhall rename to legacy/types/Step.Hook.Step.Task.Config.Output.dhall diff --git a/types/Step.Hook.Step.Task.Config.Run.dhall b/legacy/types/Step.Hook.Step.Task.Config.Run.dhall similarity index 100% rename from types/Step.Hook.Step.Task.Config.Run.dhall rename to legacy/types/Step.Hook.Step.Task.Config.Run.dhall diff --git a/types/Step.Hook.Step.Task.Config.dhall b/legacy/types/Step.Hook.Step.Task.Config.dhall similarity index 100% rename from types/Step.Hook.Step.Task.Config.dhall rename to legacy/types/Step.Hook.Step.Task.Config.dhall diff --git a/types/Step.Hook.Step.Task.dhall b/legacy/types/Step.Hook.Step.Task.dhall similarity index 100% rename from types/Step.Hook.Step.Task.dhall rename to legacy/types/Step.Hook.Step.Task.dhall diff --git a/types/Step.Hook.Step.dhall b/legacy/types/Step.Hook.Step.dhall similarity index 100% rename from types/Step.Hook.Step.dhall rename to legacy/types/Step.Hook.Step.dhall diff --git a/types/Step.Put.dhall b/legacy/types/Step.Put.dhall similarity index 100% rename from types/Step.Put.dhall rename to legacy/types/Step.Put.dhall diff --git a/types/Step.Task.Config.Cache.dhall b/legacy/types/Step.Task.Config.Cache.dhall similarity index 100% rename from types/Step.Task.Config.Cache.dhall rename to legacy/types/Step.Task.Config.Cache.dhall diff --git a/types/Step.Task.Config.ImageResource.dhall b/legacy/types/Step.Task.Config.ImageResource.dhall similarity index 100% rename from types/Step.Task.Config.ImageResource.dhall rename to legacy/types/Step.Task.Config.ImageResource.dhall diff --git a/types/Step.Task.Config.Input.dhall b/legacy/types/Step.Task.Config.Input.dhall similarity index 100% rename from types/Step.Task.Config.Input.dhall rename to legacy/types/Step.Task.Config.Input.dhall diff --git a/types/Step.Task.Config.Output.dhall b/legacy/types/Step.Task.Config.Output.dhall similarity index 100% rename from types/Step.Task.Config.Output.dhall rename to legacy/types/Step.Task.Config.Output.dhall diff --git a/types/Step.Task.Config.Run.dhall b/legacy/types/Step.Task.Config.Run.dhall similarity index 100% rename from types/Step.Task.Config.Run.dhall rename to legacy/types/Step.Task.Config.Run.dhall diff --git a/types/Step.Task.Config.dhall b/legacy/types/Step.Task.Config.dhall similarity index 100% rename from types/Step.Task.Config.dhall rename to legacy/types/Step.Task.Config.dhall diff --git a/types/Step.Task.dhall b/legacy/types/Step.Task.dhall similarity index 100% rename from types/Step.Task.dhall rename to legacy/types/Step.Task.dhall diff --git a/types/Step.dhall b/legacy/types/Step.dhall similarity index 100% rename from types/Step.dhall rename to legacy/types/Step.dhall diff --git a/types/Version.dhall b/legacy/types/Version.dhall similarity index 100% rename from types/Version.dhall rename to legacy/types/Version.dhall diff --git a/types/package.dhall b/legacy/types/package.dhall similarity index 100% rename from types/package.dhall rename to legacy/types/package.dhall diff --git a/types/resources/ChartMuseum.dhall b/legacy/types/resources/ChartMuseum.dhall similarity index 100% rename from types/resources/ChartMuseum.dhall rename to legacy/types/resources/ChartMuseum.dhall diff --git a/types/resources/ConcoursePipeline.dhall b/legacy/types/resources/ConcoursePipeline.dhall similarity index 100% rename from types/resources/ConcoursePipeline.dhall rename to legacy/types/resources/ConcoursePipeline.dhall diff --git a/types/resources/DockerImage.dhall b/legacy/types/resources/DockerImage.dhall similarity index 100% rename from types/resources/DockerImage.dhall rename to legacy/types/resources/DockerImage.dhall diff --git a/types/resources/Git.dhall b/legacy/types/resources/Git.dhall similarity index 100% rename from types/resources/Git.dhall rename to legacy/types/resources/Git.dhall diff --git a/types/resources/GithubListRepos.dhall b/legacy/types/resources/GithubListRepos.dhall similarity index 100% rename from types/resources/GithubListRepos.dhall rename to legacy/types/resources/GithubListRepos.dhall diff --git a/types/resources/GithubPR.dhall b/legacy/types/resources/GithubPR.dhall similarity index 100% rename from types/resources/GithubPR.dhall rename to legacy/types/resources/GithubPR.dhall diff --git a/types/resources/Helm.dhall b/legacy/types/resources/Helm.dhall similarity index 100% rename from types/resources/Helm.dhall rename to legacy/types/resources/Helm.dhall diff --git a/types/resources/RegistryImage.dhall b/legacy/types/resources/RegistryImage.dhall similarity index 100% rename from types/resources/RegistryImage.dhall rename to legacy/types/resources/RegistryImage.dhall diff --git a/types/resources/S3.dhall b/legacy/types/resources/S3.dhall similarity index 100% rename from types/resources/S3.dhall rename to legacy/types/resources/S3.dhall diff --git a/types/resources/S3Bucket.dhall b/legacy/types/resources/S3Bucket.dhall similarity index 100% rename from types/resources/S3Bucket.dhall rename to legacy/types/resources/S3Bucket.dhall diff --git a/types/resources/Semver.dhall b/legacy/types/resources/Semver.dhall similarity index 100% rename from types/resources/Semver.dhall rename to legacy/types/resources/Semver.dhall diff --git a/types/resources/SlackNotification.dhall b/legacy/types/resources/SlackNotification.dhall similarity index 100% rename from types/resources/SlackNotification.dhall rename to legacy/types/resources/SlackNotification.dhall diff --git a/types/resources/_unions.dhall b/legacy/types/resources/_unions.dhall similarity index 100% rename from types/resources/_unions.dhall rename to legacy/types/resources/_unions.dhall diff --git a/types/resources/package.dhall b/legacy/types/resources/package.dhall similarity index 100% rename from types/resources/package.dhall rename to legacy/types/resources/package.dhall diff --git a/package.dhall b/package.dhall new file mode 100644 index 0000000..5e59a35 --- /dev/null +++ b/package.dhall @@ -0,0 +1,10 @@ +{ resource-types = + ./resource-types/package.dhall sha256:e602ce427a7394ae5054c35c4dfbe374ecad1730d63ebc64391b6cf47d2ebcc8 + ? ./resource-types/package.dhall +, Resource = + ./Resource.dhall sha256:206f784b14f3fb78809bafffbde955fbc177ca0427c8fe9cf4a983a8aaf463c1 + ? ./Resource.dhall +, ResourceType = + ./ResourceType.dhall sha256:41ead24540852689f7d08893e4f354358a26696b1d96762e5b188615a031cc06 + ? ./ResourceType.dhall +} diff --git a/resource-types/ConcoursePipeline.dhall b/resource-types/ConcoursePipeline.dhall new file mode 100644 index 0000000..0f15d14 --- /dev/null +++ b/resource-types/ConcoursePipeline.dhall @@ -0,0 +1,77 @@ +{ meta = + { name = "concourse-pipeline" + , repository = "concourse/concourse-pipeline-resource" + } +, Version = { Type = { mapKey : Text, mapValue : Text }, default = {=} } +, Params = + { Get = { Type = {}, default = {=} } + , Put = + let Dynamic = { Type = { pipelines_file : Text }, default = {=} } + + let Static = + let Pipeline = + let Pipeline = + { Type = + { name : Text + , team : Text + , config_file : Text + , vars_files : Optional (List Text) + , unpaused : Optional Bool + } + , default = + { vars_files = None (List Text) + , unpaused = None Bool + } + } + + let test = + Pipeline::{ + , name = "test" + , team = "test" + , config_file = "test" + } + + in Pipeline + + in { Type = { pipelines : List Pipeline.Type } + , default = {=} + , Pipeline + } + + let Put = < Dynamic : Dynamic.Type | Static : Static.Type > + + in { Type = Put + , Dynamic = λ(dynamic : Dynamic.Type) → Put.Dynamic dynamic + , Static = λ(static : Static.Type) → Put.Static static + , Options = { Dynamic, Static } + } + } +, Source = + let Team = + let Team = + { Type = + { name : Text + , username : Optional Text + , password : Optional Text + } + , default = { username = None Text, password = None Text } + } + + let test = Team::{ name = "test" } + + in Team + + let Source = + { Type = + { target : Optional Text + , insecure : Optional Bool + , teams : List Team.Type + } + , default = { target = None Text, insecure = None Bool } + , Team + } + + let test = Source::{ teams = [] : List Team.Type } + + in Source +} diff --git a/resource-types/Dhall.dhall b/resource-types/Dhall.dhall new file mode 100644 index 0000000..b09a907 --- /dev/null +++ b/resource-types/Dhall.dhall @@ -0,0 +1,30 @@ +{ meta = + { name = "dhall" + , repository = "quay.io/coralogix/eng-concourse-resource-dhall" + } +, Version = { Type = { hash : Text }, default = {=} } +, Params = + { Get = { Type = {}, default = {=} }, Put = { Type = {}, default = {=} } } +, Source = + let Source = + { Type = + { expression : Text + , ascii : Optional Bool + , censor : Optional Bool + , explain : Optional Bool + , environment_variables : + Optional (List { mapKey : Text, mapValue : Text }) + } + , default = + { ascii = None Bool + , censor = None Bool + , explain = None Bool + , environment_variables = + None (List { mapKey : Text, mapValue : Text }) + } + } + + let test = Source::{ expression = "test" } + + in Source +} diff --git a/resource-types/DockerImage.dhall b/resource-types/DockerImage.dhall new file mode 100644 index 0000000..4398cf8 --- /dev/null +++ b/resource-types/DockerImage.dhall @@ -0,0 +1,122 @@ +{ meta = + { name = "docker-image", repository = "concourse/docker-image-resource" } +, Version = { Type = { digest : Text }, default = {=} } +, Params = + { Get = + let Get = + { Type = + { save : Optional Text + , rootfs : Optional Text + , skip_download : Optional Bool + } + , default = + { save = None Text + , rootfs = None Text + , skip_download = None Bool + } + } + + let test = Get::{=} + + in Get + , Put = + let Put = + { Type = + { additional_tags : Optional Text + , build : Optional Text + , build_args : + Optional (List { mapKey : Text, mapValue : Text }) + , build_args_file : Optional Text + , cache : Optional Bool + , cache_from : Optional (List Text) + , cache_tag : Optional Text + , dockerfile : Optional Text + , import_file : Optional Text + , labels : Optional (List { mapKey : Text, mapValue : Text }) + , labels_file : Optional Text + , load : Optional Text + , load_base : Optional Text + , load_bases : Optional (List Text) + , load_file : Optional Text + , load_repository : Optional Text + , load_tag : Optional Text + , tag_file : Optional Text + , tag_as_latest : Optional Bool + , tag_prefix : Optional Text + , target_name : Optional Text + } + , default = + { additional_tags = None Text + , build = None Text + , build_args = None (List { mapKey : Text, mapValue : Text }) + , build_args_file = None Text + , cache = None Bool + , cache_from = None (List Text) + , cache_tag = None Text + , dockerfile = None Text + , import_file = None Text + , labels = None (List { mapKey : Text, mapValue : Text }) + , labels_file = None Text + , load = None Text + , load_base = None Text + , load_bases = None (List Text) + , load_file = None Text + , load_repository = None Text + , load_tag = None Text + , tag_file = None Text + , tag_as_latest = None Bool + , tag_prefix = None Text + , target_name = None Text + } + } + + let test = Put::{=} + + in Put + } +, Source = + let Source = + let CaCert = { Type = { domain : Text, cert : Text }, default = {=} } + + let ClientCert = + { Type = { domain : Text, cert : Text, key : Text } + , default = {=} + } + + in { Type = + { repository : Text + , tag : Optional Text + , username : Optional Text + , password : Optional Text + , aws_access_key_id : Optional Text + , aws_secret_access_key : Optional Text + , aws_session_token : Optional Text + , insecure_registries : Optional (List Text) + , registry_mirror : Optional Text + , ca_certs : Optional (List CaCert.Type) + , client_certs : Optional (List ClientCert.Type) + , max_concurrent_downloads : Optional Natural + , max_concurrent_uploads : Optional Natural + } + , default = + { tag = None Text + , username = None Text + , password = None Text + , aws_access_key_id = None Text + , aws_secret_access_key = None Text + , aws_session_token = None Text + , insecure_registries = None (List Text) + , registry_mirror = None Text + , ca_certs = None (List CaCert.Type) + , client_certs = None (List ClientCert.Type) + , max_concurrent_downloads = None Natural + , max_concurrent_uploads = None Natural + } + , CaCert + , ClientCert + } + + let test = Source::{ repository = "test" } + + in Source +} diff --git a/resource-types/Git.dhall b/resource-types/Git.dhall new file mode 100644 index 0000000..b8325be --- /dev/null +++ b/resource-types/Git.dhall @@ -0,0 +1,155 @@ +{ meta = { name = "git", repository = "concourse/git-resource" } +, Version = { Type = { ref : Text }, default = {=} } +, Params = + { Get = + let Submodules = < Text : Text | List : List Text > + + let Get = + { Type = + { depth : Optional Natural + , fetch_tags : Optional Bool + , submodules : Optional Submodules + , submodule_recursive : Optional Bool + , submodule_remote : Optional Bool + , disable_git_lfs : Optional Bool + , clean_tags : Optional Bool + , short_ref_format : Optional Text + , describe_ref_options : Optional Text + } + , default = + { depth = None Natural + , fetch_tags = None Bool + , submodules = None Submodules + , submodule_recursive = None Bool + , submodule_remote = None Bool + , disable_git_lfs = None Bool + , clean_tags = None Bool + , short_ref_format = None Text + , describe_ref_options = None Text + } + , Submodules + } + + let test = Get::{=} + + in Get + , Put = + let Put = + { Type = + { repository : Text + , rebase : Optional Bool + , merge : Optional Bool + , returning : Optional Text + , tag : Optional Text + , only_tag : Optional Bool + , tag_prefix : Optional Text + , force : Optional Bool + , annotate : Optional Text + , notes : Optional Text + } + , default = + { rebase = None Bool + , merge = None Bool + , returning = None Text + , tag = None Text + , only_tag = None Bool + , tag_prefix = None Text + , force = None Bool + , annotate = None Text + , notes = None Text + } + } + + let test = Put::{ repository = "test" } + + in Put + } +, Source = + let SubmoduleCredential = + { Type = { host : Text, username : Text, password : Text } + , default = {=} + } + + let HttpsTunnel = + let HttpsTunnel = + { Type = + { proxy_host : Text + , proxy_port : Text + , proxy_user : Optional Text + , proxy_password : Optional Text + } + , default = + { proxy_user = None Text, proxy_password = None Text } + } + + let test = HttpsTunnel::{ proxy_host = "test", proxy_port = "test" } + + in HttpsTunnel + + let CommitFilter = + let CommitFilter = + { Type = + { exclude : Optional (List Text) + , include : Optional (List Text) + } + , default = + { exclude = None (List Text), include = None (List Text) } + } + + let test = CommitFilter::{=} + + in CommitFilter + + let Source = + { Type = + { uri : Text + , branch : Optional Text + , private_key : Optional Text + , forward_agent : Optional Bool + , username : Optional Text + , password : Optional Text + , paths : Optional (List Text) + , ignore_paths : Optional (List Text) + , skip_ssl_verification : Optional Bool + , tag_filter : Optional Text + , fetch_tags : Optional Bool + , submodule_credentials : Optional (List SubmoduleCredential.Type) + , git_config : Optional (List { mapKey : Text, mapValue : Text }) + , disable_ci_skip : Optional Bool + , commit_verification_keys : Optional (List Text) + , commit_verification_key_ids : Optional (List Text) + , gpg_keyserver : Optional Text + , git_crypt_key : Optional Text + , https_tunnel : Optional HttpsTunnel.Type + , commit_filter : Optional CommitFilter.Type + } + , default = + { branch = None Text + , private_key = None Text + , forward_agent = None Bool + , username = None Text + , password = None Text + , paths = None (List Text) + , ignore_paths = None (List Text) + , skip_ssl_verification = None Bool + , tag_filter = None Text + , fetch_tags = None Bool + , submodule_credentials = None (List SubmoduleCredential.Type) + , git_config = None (List { mapKey : Text, mapValue : Text }) + , disable_ci_skip = None Bool + , commit_verification_keys = None (List Text) + , commit_verification_key_ids = None (List Text) + , gpg_keyserver = None Text + , git_crypt_key = None Text + , https_tunnel = None HttpsTunnel.Type + , commit_filter = None CommitFilter.Type + } + , SubmoduleCredential + , HttpsTunnel + , CommitFilter + } + + let test = Source::{ uri = "test" } + + in Source +} diff --git a/resource-types/GitMultibranch.dhall b/resource-types/GitMultibranch.dhall new file mode 100644 index 0000000..3265675 --- /dev/null +++ b/resource-types/GitMultibranch.dhall @@ -0,0 +1,89 @@ +{ meta = + { name = "git-multibranch" + , repository = "cfcommunity/git-multibranch-resource" + } +, Version = { Type = { ref : Text }, default = {=} } +, Params = + { Get = + let Submodules = < Text : Text | List : List Text > + + let Get = + { Type = + { depth : Optional Natural, submodules : Optional Submodules } + , default = { depth = None Natural, submodules = None Submodules } + , Submodules + } + + let test = Get::{=} + + in Get + , Put = + let Put = + { Type = + { repository : Text + , rebase : Optional Bool + , tag : Optional Text + , only_tag : Optional Bool + , tag_prefix : Optional Text + } + , default = + { rebase = None Bool + , tag = None Text + , only_tag = None Bool + , tag_prefix = None Text + } + } + + let test = Put::{ repository = "test" } + + in Put + } +, Source = + let Redis = + let Redis = + { Type = + { host : Text + , password : Optional Text + , prefix : Optional Text + , db_number : Optional Natural + } + , default = + { password = None Text + , prefix = None Text + , db_number = None Natural + } + } + + let test = Redis::{ host = "test" } + + in Redis + + let Source = + { Type = + { uri : Text + , branch : Optional Text + , private_key : Optional Text + , paths : Optional (List Text) + , ignore_paths : Optional (List Text) + , skip_ssl_verification : Optional Bool + , branches : Optional Text + , ignore_branches : Optional Text + , redis : Optional Redis.Type + } + , default = + { branch = None Text + , private_key = None Text + , paths = None (List Text) + , ignore_paths = None (List Text) + , skip_ssl_verification = None Bool + , branches = None Text + , ignore_branches = None Text + , redis = None Redis.Type + } + , Redis + } + + let test = Source::{ uri = "test" } + + in Source +} diff --git a/resource-types/GithubListRepos.dhall b/resource-types/GithubListRepos.dhall new file mode 100644 index 0000000..0c27745 --- /dev/null +++ b/resource-types/GithubListRepos.dhall @@ -0,0 +1,64 @@ +{ meta = + { name = "github-list-repos" + , repository = "quay.io/coralogix/concourse-resource-github-list-repos" + } +, Version = { Type = { hash : Text }, default = {=} } +, Params = + { Get = + { Type = { output_format : Optional Text } + , default.output_format = None Text + } + , Put = { Type = {}, default = {=} } + } +, Source = + let Exclude = + let Exclude = + { Type = + { auth_token : Text + , org : Text + , team : Optional Text + , v4_endpoint : Optional Text + , exclude_regex : Optional Text + , exclude : Optional (List Text) + } + , default = + { team = None Text + , v4_endpoint = None Text + , exclude_regex = None Text + , exclude = None (List Text) + } + } + + let test = Exclude::{ auth_token = "test", org = "test" } + + in Exclude + + let Include = + let Include = + { Type = + { auth_token : Text + , org : Text + , team : Optional Text + , v4_endpoint : Optional Text + , include_regex : Text + } + , default = { team = None Text, v4_endpoint = None Text } + } + + let test = + Include::{ + , auth_token = "test" + , org = "test" + , include_regex = "test" + } + + in Include + + let Source = < Exclude : Exclude.Type | Include : Include.Type > + + in { Type = Source + , Exclude = λ(exclude : Exclude.Type) → Source.Exclude exclude + , Include = λ(include : Include.Type) → Source.Include include + , Options = { Exclude, Include } + } +} diff --git a/resource-types/GithubPR.dhall b/resource-types/GithubPR.dhall new file mode 100644 index 0000000..b192db6 --- /dev/null +++ b/resource-types/GithubPR.dhall @@ -0,0 +1,96 @@ +{ meta = { name = "pull-request", repository = "teliaoss/github-pr-resource" } +, Version = + { Type = { pr : Text, commit : Text, committed : Optional Text } + , default.committed = None Text + } +, Params = + { Get = + let Get = + { Type = + { skip_download : Optional Bool + , integration_tool : Optional Text + , git_depth : Optional Natural + , submodules : Optional Bool + , list_changed_files : Optional Bool + } + , default = + { skip_download = None Bool + , integration_tool = None Text + , git_depth = None Natural + , submodules = None Bool + , list_changed_files = None Bool + } + } + + let test = Get::{=} + + in Get + , Put = + let Put = + { Type = + { path : Text + , status : Optional Text + , base_context : Optional Text + , context : Optional Text + , comment : Optional Text + , comment_file : Optional Text + , target_url : Optional Text + , description : Optional Text + , description_file : Optional Text + , delete_previous_comments : Optional Bool + } + , default = + { status = None Text + , base_context = None Text + , context = None Text + , comment = None Text + , comment_file = None Text + , target_url = None Text + , description = None Text + , description_file = None Text + , delete_previous_comments = None Bool + } + } + + let test = Put::{ path = "test" } + + in Put + } +, Source = + let Source = + { Type = + { repository : Text + , access_token : Text + , v3_endpoint : Optional Text + , v4_endpoint : Optional Text + , paths : Optional (List Text) + , ignore_paths : Optional (List Text) + , disable_ci_skip : Optional Bool + , skip_ssl_verification : Optional Bool + , disable_forks : Optional Bool + , required_review_approvals : Optional Natural + , git_crypt_key : Optional Text + , base_branch : Optional Text + , labels : Optional (List Text) + } + , default = + { repository = Text + , access_token = Text + , v3_endpoint = None Text + , v4_endpoint = None Text + , paths = None (List Text) + , ignore_paths = None (List Text) + , disable_ci_skip = None Bool + , skip_ssl_verification = None Bool + , disable_forks = None Bool + , required_review_approvals = None Natural + , git_crypt_key = None Text + , base_branch = None Text + , labels = None (List Text) + } + } + + let test = Source::{ repository = "test", access_token = "test" } + + in Source +} diff --git a/resource-types/RegistryImage.dhall b/resource-types/RegistryImage.dhall new file mode 100644 index 0000000..fa09537 --- /dev/null +++ b/resource-types/RegistryImage.dhall @@ -0,0 +1,100 @@ +{ meta = + { name = "registry-image", repository = "concourse/registry-image-resource" } +, Version = { Type = { digest : Text }, default = {=} } +, Params = + { Get = + let Get = + { Type = { format : Optional Text, skip_download : Optional Bool } + , default = { format = None Text, skip_download = None Bool } + } + + let test = Get::{=} + + in Get + , Put = + let Put = + { Type = { image : Text, additional_tags : Optional Text } + , default.additional_tags = None Text + } + + let test = Put::{ image = "test" } + + in Put + } +, Source = + let Source = + let RegistryMirror = + let RegistryMirror = + { Type = + { host : Text + , username : Optional Text + , password : Optional Text + } + , default = { username = None Text, password = None Text } + } + + let test = RegistryMirror::{ host = "test" } + + in RegistryMirror + + let ContentTrust = + let ContentTrust = + { Type = + { server : Optional Text + , repository_key_id : Text + , repository_key : Text + , repository_passphrase : Text + , tls_key : Optional Text + , tls_cert : Optional Text + } + , default = + { server = None Text + , tls_key = None Text + , tls_cert = None Text + } + } + + let test = + ContentTrust::{ + , repository_key_id = "test" + , repository_key = "test" + , repository_passphrase = "test" + } + + in ContentTrust + + in { Type = + { repository : Text + , tag : Optional Text + , username : Optional Text + , password : Optional Text + , aws_access_key_id : Optional Text + , aws_secret_access_key : Optional Text + , aws_session_token : Optional Text + , aws_region : Optional Text + , aws_role_arn : Optional Text + , debug : Optional Bool + , registry_mirror : Optional RegistryMirror.Type + , content_trust : Optional ContentTrust.Type + } + , default = + { tag = None Text + , username = None Text + , password = None Text + , aws_access_key_id = None Text + , aws_secret_access_key = None Text + , aws_session_token = None Text + , aws_region = None Text + , aws_role_arn = None Text + , debug = None Bool + , registry_mirror = None RegistryMirror.Type + , content_trust = None ContentTrust.Type + } + , RegistryMirror + , ContentTrust + } + + let test = Source::{ repository = "test" } + + in Source +} diff --git a/resource-types/S3.dhall b/resource-types/S3.dhall new file mode 100644 index 0000000..d4bb713 --- /dev/null +++ b/resource-types/S3.dhall @@ -0,0 +1,88 @@ +{ meta = { name = "s3", repository = "concourse/s3-resource" } +, Version = { Type = { version_id : Text }, default = {=} } +, Params = + { Get = + let Get = + { Type = + { skip_download : Optional Bool + , unpack : Optional Bool + , download_tags : Optional Bool + } + , default = + { skip_download = None Bool + , unpack = None Bool + , download_tags = None Bool + } + } + + let test = Get::{=} + + in Get + , Put = + let Put = + { Type = + { file : Text + , acl : Optional Text + , content_type : Optional Text + } + , default = { acl = None Text, content_type = None Text } + } + + let test = Put::{ file = "test" } + + in Put + } +, Source = + let Source = + { Type = + { bucket : Text + , access_key_id : Optional Text + , secret_access_key : Optional Text + , session_token : Optional Text + , region_name : Optional Text + , private : Optional Bool + , cloudfront_url : Optional Text + , endpoint : Optional Text + , disable_ssl : Optional Bool + , skip_ssl_verification : Optional Bool + , skip_download : Optional Bool + , server_side_encryption : Optional Text + , sse_kms_key_id : Optional Text + , use_v2_signing : Optional Bool + , disable_multipart : Optional Bool + , regexp : Optional Text + , versioned_file : Optional Text + , initial_path : Optional Text + , initial_version : Optional Text + , initial_content_text : Optional Text + , initial_content_binary : Optional Text + } + , default = + { bucket = Text + , access_key_id = None Text + , secret_access_key = None Text + , session_token = None Text + , region_name = None Text + , private = None Bool + , cloudfront_url = None Text + , endpoint = None Text + , disable_ssl = None Bool + , skip_ssl_verification = None Bool + , skip_download = None Bool + , server_side_encryption = None Text + , sse_kms_key_id = None Text + , use_v2_signing = None Bool + , disable_multipart = None Bool + , regexp = None Text + , versioned_file = None Text + , initial_path = None Text + , initial_version = None Text + , initial_content_text = None Text + , initial_content_binary = None Text + } + } + + let test = Source::{ bucket = "test" } + + in Source +} diff --git a/resource-types/S3Bucket.dhall b/resource-types/S3Bucket.dhall new file mode 100644 index 0000000..32f9b02 --- /dev/null +++ b/resource-types/S3Bucket.dhall @@ -0,0 +1,27 @@ +{ meta = { name = "s3bucket", repository = "18fgsa/s3-resource-simple" } +, Version = { Type = {}, default = {=} } +, Params = + { Get = { Type = {}, default = {=} }, Put = { Type = {}, default = {=} } } +, Source = + let Source = + { Type = + { bucket : Text + , path : Optional Text + , options : Optional (List Text) + , access_key_id : Optional Text + , secret_access_key : Optional Text + , region : Optional Text + } + , default = + { path = None Text + , options = None (List Text) + , access_key_id = None Text + , secret_access_key = None Text + , region = None Text + } + } + + let test = Source::{ bucket = "test" } + + in Source +} diff --git a/resource-types/SlackNotification.dhall b/resource-types/SlackNotification.dhall new file mode 100644 index 0000000..ce0a0a4 --- /dev/null +++ b/resource-types/SlackNotification.dhall @@ -0,0 +1,127 @@ +{ meta = + { name = "slack-notification" + , repository = "cfcommunity/slack-notification-resource" + } +, Version = { Type = {}, default = {=} } +, Params = + { Get = { Type = {}, default = {=} } + , Put = + let Attachment = + let Field = + let Field = + { Type = + { title : Optional Text + , value : Optional Text + , short : Optional Bool + } + , default = + { title = None Text + , value = None Text + , short = None Bool + } + } + + let test = Field::{=} + + in Field + + let Attachment = + { Type = + { fallback : Optional Text + , color : Optional Text + , pretext : Optional Text + , author_name : Optional Text + , author_link : Optional Text + , author_icon : Optional Text + , title : Optional Text + , title_link : Optional Text + , text : Optional Text + , fields : Optional (List Field.Type) + , mrkdwn_in : Optional (List Text) + , image_url : Optional Text + , thumb_url : Optional Text + , footer : Optional Text + , footer_icon : Optional Text + , ts : Optional Natural + } + , default = + { fallback = None Text + , color = None Text + , pretext = None Text + , author_name = None Text + , author_link = None Text + , author_icon = None Text + , title = None Text + , title_link = None Text + , text = None Text + , fields = None (List Field.Type) + , mrkdwn_in = None (List Text) + , image_url = None Text + , thumb_url = None Text + , footer = None Text + , footer_icon = None Text + , ts = None Natural + } + , Field + } + + let test = Attachment::{=} + + in Attachment + + let Put = + { Type = + { text : Optional Text + , text_file : Optional Text + , attachments : Optional (List Attachment.Type) + , attachments_file : Optional Text + , channel : Optional Text + , channel_file : Optional Text + , env_file : Optional Text + , username : Optional Text + , icon_url : Optional Text + , icon_emoji : Optional Text + , silent : Optional Bool + , always_notify : Optional Bool + } + , default = + { text = None Text + , text_file = None Text + , attachments = None (List Attachment.Type) + , attachments_file = None Text + , channel = None Text + , channel_file = None Text + , env_file = None Text + , username = None Text + , icon_url = None Text + , icon_emoji = None Text + , silent = None Bool + , always_notify = None Bool + } + , Attachment + } + + let test = Put::{=} + + in Put + } +, Source = + let CaCert = { Type = { domain : Text, cert : Text }, default = {=} } + + in { Type = + { url : Text + , insecure : Optional Bool + , proxy : Optional Text + , proxy_https_tunnel : Optional Bool + , disable : Optional Bool + , ca_certs : Optional (List CaCert.Type) + } + , default = + { insecure = None Bool + , proxy = None Text + , proxy_https_tunnel = None Bool + , disable = None Bool + , ca_certs = None (List CaCert.Type) + } + } +} diff --git a/resource-types/package.dhall b/resource-types/package.dhall new file mode 100644 index 0000000..9f5e267 --- /dev/null +++ b/resource-types/package.dhall @@ -0,0 +1,34 @@ +{ ConcoursePipeline = + ./ConcoursePipeline.dhall sha256:e2229add33a80283eb3c1c29f91c2a6cdc9e90a2ded04048d221c5d53048ccb0 + ? ./ConcoursePipeline.dhall +, Dhall = + ./Dhall.dhall sha256:49dab2ab893b7a4a0e1e39bbe3e28f383f5079e89fe143d1a694c38835cc566b + ? ./Dhall.dhall +, DockerImage = + ./DockerImage.dhall sha256:fefdd6afd28509eabd06008093cfe523ff4ea0c1f50b975f658204ce7f3f3c59 + ? ./DockerImage.dhall +, Git = + ./Git.dhall sha256:830b9d7d0e9e0992ee2473f78e05838a86be3e13c7bcf5df661b8829dbc3d558 + ? ./Git.dhall +, GitMultibranch = + ./GitMultibranch.dhall sha256:98145e49333017e27c759b3bb02aeaefc14dc89b207afd74d2c1ebdc64a59b48 + ? ./GitMultibranch.dhall +, GithubListRepos = + ./GithubListRepos.dhall sha256:ccef397287d7c01c9243c517b8f407a68299bdc2f6ad8386410194e9dfd2e3e0 + ? ./GithubListRepos.dhall +, GithubPR = + ./GithubPR.dhall sha256:34fc7517dff51abc3ecfcf879506940e76e5339c893e5f6ade0d025bb992b2cc + ? ./GithubPR.dhall +, RegistryImage = + ./RegistryImage.dhall sha256:2ca4df79f82f54275f919d759344a6478749f7d0f32bddbc0389877ede11da03 + ? ./RegistryImage.dhall +, S3 = + ./S3.dhall sha256:6e062defd2cf94a3f7840d1b09c7a832d0a92467f5924a2b812843c053a8eca5 + ? ./S3.dhall +, S3Bucket = + ./S3Bucket.dhall sha256:fc95953a8603a450c4e34b7394714332ede9759436256f153d00a829fddccc31 + ? ./S3Bucket.dhall +, SlackNotification = + ./SlackNotification.dhall sha256:637b51d4ea5273e22d60c4c3dcee9ebc87e4316254abcf1c4ba27fe7d9cc720f + ? ./SlackNotification.dhall +}