Files
gitea-resource/README.md
2020-01-11 02:32:40 -05:00

71 lines
2.0 KiB
Markdown

[![Docker Repository on Quay](https://quay.io/repository/avanier/gitea-resource/status "Docker Repository on Quay")](https://quay.io/repository/avanier/gitea-resource)
# gitea-resource
A Concourse resource to interact with Gitea.
## Installation
```yaml
resource_types:
- name: gitea-pr
type: registry-image
source:
repository: quay.io/avanier/gitea-resource
tag: latest-pr
resrouces:
- name: some-repo-pr
type: gitea-pr
source:
access_token: ((my_cred.token))
repo: some-repo
owner: some_user_or_org
hostname: privatehost.example
port: 443 # default, optional
insecure: false # default, optional, true uses http instead of https
skip_ssl_verification: false # default, optional, ignore invalid certificates
```
## Usage
### `check`
This resource is opinionated, and does not allow you to track every commit on
every PR. All it does for now is allow you to know when new PRs are created, and
it returns the PR number as a ref.
### `in`
When you `get` a ref, the resource will provide the raw Gitea API payload, and
the Concourse metadata for that PR as the following files:
```plaintext
some-repo-pr/pr.json
some-repo-pr/metadata.json
```
The intent is to parse this with `jq` in a separate task to get the branch, and
template a pipeline for every PR with the [`fly-resource`][fly-resource]. It's
the only way to avoid PR race conditions.
[fly-resource]: https://github.com/troykinsella/concourse-fly-resource
### `out`
`noop`
## FAQ
- **I'd like to set the CI status for those PRs.** It's an incoming feature. I
organized my code to be able to have a single codebase to do all the
operations on Gitea. Right now only listing and querying PRs is implemented,
but that's why the `base` image is separate from the `pr` image. I'll
eventually probably implement `singlepr` and `release`. The [`pr`][pr-image] image only
has one extra layer which puts the right commands in the `$PATH`.
[pr-image]: ./Dockerfile.pr
## Issues
<https://todo.sr.ht/~avanier/gitea-resource-issue-tracker>