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

Commit

Permalink
Add github release resource (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShauliSolomovich authored Jul 20, 2020
1 parent edbc577 commit 7b0d512
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 5 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This allows the user to more easily generate type-safe Concourse CI pipelines, t
* 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)
* 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)
* Registry Image - [`concourse/registry-image-resource`](https://github.com/concourse/registry-image-resource)
* S3 - [`concourse/s3-resource`](https://github.com/concourse/s3-resource)
Expand All @@ -26,7 +27,7 @@ This allows the user to more easily generate type-safe Concourse CI pipelines, t
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.6.1/package.dhall sha256:ab25d95aaf255b8fc9572b58650c1850c9a4395d411576ced75611b893561c16
https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.7.0/package.dhall sha256:d2f16eefdd12b916b517b538e789bc87ec2d7ebf7c78fb6292802038a53c0cd6
```

## Intended Usage
Expand All @@ -50,16 +51,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.6.1/resource-types/Git.dhall sha256:830b9d7d0e9e0992ee2473f78e05838a86be3e13c7bcf5df661b8829dbc3d558
let Git = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.7.0/resource-types/Git.dhall sha256:830b9d7d0e9e0992ee2473f78e05838a86be3e13c7bcf5df661b8829dbc3d558

let S3 = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.6.1/resource-types/S3.dhall sha256:d9129408caf467ffa23f16470313cb58d4725687d26e043ee015c75b87f3c679
let S3 = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.7.0/resource-types/S3.dhall sha256:d9129408caf467ffa23f16470313cb58d4725687d26e043ee015c75b87f3c679

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.6.1/Resource.dhall sha256:206f784b14f3fb78809bafffbde955fbc177ca0427c8fe9cf4a983a8aaf463c1
let import = https://raw.githubusercontent.com/coralogix/dhall-concourse/v0.7.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:19713724811bedcdbbaf2e3475877337f4c63582c36c91ecfc4e90a9f6eb694e
./resource-types/package.dhall sha256:97e8de50c3a47720f82c5a401aee7fc0cdf124a1240d63ab69ce08372922c56c
? ./resource-types/package.dhall
, Resource =
./Resource.dhall sha256:206f784b14f3fb78809bafffbde955fbc177ca0427c8fe9cf4a983a8aaf463c1
Expand Down
79 changes: 79 additions & 0 deletions resource-types/GithubRelease.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{ meta =
{ name = "github-release", repository = "concourse/github-release-resource" }
, Version =
{ Type =
{ id : Optional Text, timestamp : Optional Text, tag : Optional Text }
, default = { id = None Text, timestamp = None Text, tag = None Text }
}
, Params =
{ Get =
let Get =
{ Type =
{ globs : Optional (List Text)
, include_source_tarball : Optional Bool
, include_source_zip : Optional Bool
}
, default =
{ globs = None (List Text)
, include_source_tarball = None Bool
, include_source_zip = None Bool
}
}

let test = Get::{=}

in Get
, Put =
let Put =
{ Type =
{ name : Text
, tag : Text
, tag_prefix : Optional Text
, commitish : Optional Text
, body : Optional Text
, globs : Optional (List Text)
}
, default =
{ tag_prefix = None Text
, commitish = None Text
, body = None Text
, globs = None (List Text)
}
}

let test = Put::{ name = "test", tag = "0.1.0" }

in Put
}
, Source =
let Source =
{ Type =
{ owner : Text
, repository : Text
, access_token : Optional Text
, github_api_url : Optional Text
, github_uploads_url : Optional Text
, insecure : Optional Bool
, release : Optional Bool
, pre_release : Optional Bool
, drafts : Optional Bool
, tag_filter : Optional Text
, order_by : Optional Text
}
, default =
{ access_token = None Text
, github_api_url = None Text
, github_uploads_url = None Text
, insecure = None Bool
, release = None Bool
, pre_release = None Bool
, drafts = None Bool
, tag_filter = None Text
, order_by = None Text
}
}

let test = Source::{ repository = "test", owner = "test" }

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

0 comments on commit 7b0d512

Please sign in to comment.