From 491cbd1d01092997a264f960bea6c32fce37921c Mon Sep 17 00:00:00 2001 From: Ari Becker Date: Wed, 20 Jan 2021 06:31:53 -0500 Subject: [PATCH] Add Coralogix Event resource (#19) --- README.md | 13 ++++---- package.dhall | 2 +- resource-types/CoralogixEvent.dhall | 51 +++++++++++++++++++++++++++++ resource-types/package.dhall | 3 ++ 4 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 resource-types/CoralogixEvent.dhall diff --git a/README.md b/README.md index c8ee274..b76620e 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ This allows the user to more easily generate type-safe Concourse CI pipelines, t ### Supported Resources * Concourse Pipeline - [`concourse/concourse-pipeline-resource`](https://github.com/concourse/concourse-pipeline-resource) +* Coralogix Event - [`coralogix/eng-concourse-resource-coralogix-event`](https://github.com/coralogix/eng-concourse-resource-coralogix-event) * 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) @@ -31,11 +32,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.9.1/domain.dhall sha256:036b9de47a7f54d4ed21b87c50987fb8a318c62524d7f6317d3ec98bbe9c784c + https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.10.0/domain.dhall sha256:036b9de47a7f54d4ed21b87c50987fb8a318c62524d7f6317d3ec98bbe9c784c ∧ { RegistryImage = - https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.9.1/resource-types/RegistryImage.dhall sha256:2ca4df79f82f54275f919d759344a6478749f7d0f32bddbc0389877ede11da03 + https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.10.0/resource-types/RegistryImage.dhall sha256:2ca4df79f82f54275f919d759344a6478749f7d0f32bddbc0389877ede11da03 , Git = - https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.9.1/resource-types/Git.dhall sha256:830b9d7d0e9e0992ee2473f78e05838a86be3e13c7bcf5df661b8829dbc3d558 + https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.10.0/resource-types/Git.dhall sha256:830b9d7d0e9e0992ee2473f78e05838a86be3e13c7bcf5df661b8829dbc3d558 } in Concourse @@ -63,16 +64,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.9.1/resource-types/Git.dhall sha256:830b9d7d0e9e0992ee2473f78e05838a86be3e13c7bcf5df661b8829dbc3d558 +let Git = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.10.0/resource-types/Git.dhall sha256:830b9d7d0e9e0992ee2473f78e05838a86be3e13c7bcf5df661b8829dbc3d558 -let S3 = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.9.1/resource-types/S3.dhall sha256:b49ec06747630f6d6951fde4f04f7bbffab7cee1a9ef299464314ad049422d04 +let S3 = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.10.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.9.1/Resource.dhall sha256:206f784b14f3fb78809bafffbde955fbc177ca0427c8fe9cf4a983a8aaf463c1 + let import = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.10.0/Resource.dhall sha256:206f784b14f3fb78809bafffbde955fbc177ca0427c8fe9cf4a983a8aaf463c1 in import { Source, Version } diff --git a/package.dhall b/package.dhall index 2beb0ba..1e03f60 100644 --- a/package.dhall +++ b/package.dhall @@ -1,5 +1,5 @@ { resource-types = - ./resource-types/package.dhall sha256:8d480d97bee6a70f06fd41587a8785a0c73450631642e160e297663eb164e039 + ./resource-types/package.dhall sha256:fc1d84e1b7901ca2b90b3dd11e8688a09a8490427ecbe226694d91f74823005c ? ./resource-types/package.dhall } ∧ ( ./domain.dhall sha256:036b9de47a7f54d4ed21b87c50987fb8a318c62524d7f6317d3ec98bbe9c784c diff --git a/resource-types/CoralogixEvent.dhall b/resource-types/CoralogixEvent.dhall new file mode 100644 index 0000000..3ca07f6 --- /dev/null +++ b/resource-types/CoralogixEvent.dhall @@ -0,0 +1,51 @@ +{ meta = + { name = "coralogix-event" + , repository = "quay.io/coralogix/eng-coralogix-event-resource" + } +, Version = { Type = {}, default = {=} } +, Params = + { Get = { Type = {}, default = {=} } + , Put = + let Put = + { Type = + { build_status : Text + , severity : Optional Text + , message : Optional Text + , labels : Optional (List { mapKey : Text, mapValue : Text }) + , additional_details_file : Optional Text + , dry_mode : Optional Bool + } + , default = + { severity = None Text + , message = None Text + , labels = None (List { mapKey : Text, mapValue : Text }) + , additional_details_file = None Text + , dry_mode = None Bool + } + } + + let test = Put::{ build_status = "mock_build_status" } + + in Put + } +, Source = + let Source = + { Type = + { private_key : Text + , application_name : Optional Text + , subsystem_name : Optional Text + , coralogix_host : Optional Text + , concourse_url : Optional Text + } + , default = + { application_name = None Text + , subsystem_name = None Text + , coralogix_host = None Text + , concourse_url = None Text + } + } + + let test = Source::{ private_key = "mock_private_key" } + + in Source +} diff --git a/resource-types/package.dhall b/resource-types/package.dhall index fa6810a..408bd45 100644 --- a/resource-types/package.dhall +++ b/resource-types/package.dhall @@ -1,6 +1,9 @@ { ConcoursePipeline = ./ConcoursePipeline.dhall sha256:e2229add33a80283eb3c1c29f91c2a6cdc9e90a2ded04048d221c5d53048ccb0 ? ./ConcoursePipeline.dhall +, CoralogixEvent = + ./CoralogixEvent.dhall sha256:c32bedf3eda23d4d7ca10184211d114c809ecf6d61e002f386cf99aad8dc0d27 + ? ./CoralogixEvent.dhall , Dhall = ./Dhall.dhall sha256:49dab2ab893b7a4a0e1e39bbe3e28f383f5079e89fe143d1a694c38835cc566b ? ./Dhall.dhall