Skip to content

Commit

Permalink
Add readme file and AH annotations to Helm chart (#235)
Browse files Browse the repository at this point in the history
Signed-off-by: Sergio Castaño Arteaga <[email protected]>
  • Loading branch information
tegioz authored Feb 21, 2023
1 parent 94f51ad commit 8227a21
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 24 deletions.
22 changes: 20 additions & 2 deletions charts/gitvote/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ apiVersion: v2
name: gitvote
description: GitVote is a GitHub application that allows holding a vote on issues and pull requests
type: application
version: 0.1.0
appVersion: 0.1.0
version: 0.2.0
appVersion: 0.2.0
kubeVersion: ">= 1.19.0-0"
home: https://gitvote.dev
icon: https://raw.githubusercontent.com/cncf/gitvote/main/docs/logo/logo.png
keywords:
- git
- vote
Expand All @@ -18,3 +20,19 @@ dependencies:
version: 8.2.1
repository: https://charts.helm.sh/stable
condition: postgresql.enabled
annotations:
artifacthub.io/category: skip-prediction
artifacthub.io/changes: |
- kind: added
description: Initial version
artifacthub.io/containsSecurityUpdates: "true"
artifacthub.io/images: |
- name: dbmigrator
image: public.ecr.aws/g6m3a0y9/gitvote-dbmigrator
- name: gitvote
image: public.ecr.aws/g6m3a0y9/gitvote
artifacthub.io/links: |
- name: source
url: https://github.com/cncf/gitvote
- name: support
url: https://github.com/cncf/gitvote/issues
73 changes: 73 additions & 0 deletions charts/gitvote/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# GitVote

[GitVote](https://gitvote.dev) is a GitHub application that allows holding a vote on issues and pull requests.

## Introduction

This chart bootstraps a GitVote deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.

## Prerequisites

Before installing this chart, you need to [setup a GitHub application](https://docs.github.com/en/apps/creating-github-apps/creating-github-apps/creating-a-github-app). The application requires the following permissions [to be set](https://docs.github.com/en/apps/maintaining-github-apps/editing-a-github-apps-permissions):

Repository:

- **Checks**: *read/write*
- **Contents**: *read*
- **Issues**: *read/write*
- **Metadata**: *read*
- **Pull requests**: *read/write*

Organization:

- **Members**: *read*

In addition to those permissions, it must also be subscribed to the following events:

- *Issue Comment*
- *Issues*
- *Pull Request*

GitVote expects GitHub events to be sent to the `/api/events` endpoint. In the GitHub application, please enable `webhook` and set the target URL to your exposed endpoint (ie: <https://example.com/api/events>). You will need to define a random secret for the webhook (you can use the following command to do it: `openssl rand -hex 32`). Please note your webhook secret, as well as the GitHub application ID and private key, as you'll need them in the next step when installing the chart.

Once your GitHub application is ready and GitVote has been deployed, you can install it in the organizations or repositories you need.

## Installing the chart

Create a values file (`my-values.yaml`) that includes the configuration values required from your GitHub application:

```yaml
gitvote:
github:
appID: 123456 # Replace with your GitHub app ID
appPrivateKey: |-
-----BEGIN RSA PRIVATE KEY-----
...
YOUR_APP_PRIVATE_KEY
...
-----END RSA PRIVATE KEY-----
webhookSecret: "your-webhook-secret"
```
To install the chart with the release name `my-gitvote` run:

```bash
$ helm repo add gitvote https://cncf.github.io/gitvote/
$ helm install --values my-values.yaml my-gitvote gitvote/gitvote
```

The command above deploys GitVote on the Kubernetes cluster using the default configuration values and the GitHub application configuration provided. Please see the [chart's default values file](https://github.com/cncf/gitvote/blob/main/charts/gitvote/values.yaml) for a list of all the configurable parameters of the chart and their default values.

## Uninstalling the chart

To uninstall the `my-gitvote` deployment run:

```bash
$ helm uninstall my-gitvote
```

This command removes all the Kubernetes components associated with the chart and deletes the release.

## How GitVote works

For more information about how GitVote works from a user's perspective please see the [repository's README file](https://github.com/cncf/gitvote#readme).
24 changes: 2 additions & 22 deletions charts/gitvote/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,8 @@ gitvote:

# GitHub configuration
#
# The app require the following permissions:
# - Repository permissions:
# - Checks: read/write
# - Contents: read
# - Issues: read/write
# - Metadata: read
# - Pull requests: read/write
# - Organization
# - Members: read
#
# Subscribe to events:
# - Issue Comment
# - Issues
# - Pull Request
#
# GitVote can process GitHub webhooks data sent to /api/events.
# In the GitHub app, enable webhook and set the target URL to your exposed
# endpoint, ie: https://example.com/api/events
# Define a random webhook secret, you can use the following command to
# generate one: openssl rand -hex 32
# After creating the app, download the private key an fill-up the values
# below:
# For more information about the permissions and events required please see
# the chart's readme file.
github:
# GitHub application ID
appID: null
Expand Down

0 comments on commit 8227a21

Please sign in to comment.