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

Commit

Permalink
Add Coralogix Event resource (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
ari-becker authored Jan 20, 2021
1 parent 9e6f66d commit 491cbd1
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 7 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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 }

Expand Down
2 changes: 1 addition & 1 deletion package.dhall
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ resource-types =
./resource-types/package.dhall sha256:8d480d97bee6a70f06fd41587a8785a0c73450631642e160e297663eb164e039
./resource-types/package.dhall sha256:fc1d84e1b7901ca2b90b3dd11e8688a09a8490427ecbe226694d91f74823005c
? ./resource-types/package.dhall
}
( ./domain.dhall sha256:036b9de47a7f54d4ed21b87c50987fb8a318c62524d7f6317d3ec98bbe9c784c
Expand Down
51 changes: 51 additions & 0 deletions resource-types/CoralogixEvent.dhall
Original file line number Diff line number Diff line change
@@ -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
}
3 changes: 3 additions & 0 deletions resource-types/package.dhall
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 491cbd1

Please sign in to comment.