Skip to content

Commit b63e3e5

Browse files
committed
Auto generate chart readme file
Signed-off-by: Tamal Saha <tamal@appscode.com>
1 parent dea1a41 commit b63e3e5

File tree

4 files changed

+72
-33
lines changed

4 files changed

+72
-33
lines changed

Makefile

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,23 @@ gen-values-schema:
263263
@yq r api/crds/installer.stash.appscode.com_stashpostgreses.yaml spec.validation.openAPIV3Schema.properties.spec > /tmp/stash-postgres-values.openapiv3_schema.yaml
264264
@yq d /tmp/stash-postgres-values.openapiv3_schema.yaml description > charts/stash-postgres/values.openapiv3_schema.yaml
265265

266+
.PHONY: gen-chart-doc
267+
gen-chart-doc: gen-chart-doc-stash-postgres
268+
269+
gen-chart-doc-%:
270+
@echo "Generate $* chart docs"
271+
@docker run --rm \
272+
-u $$(id -u):$$(id -g) \
273+
-v /tmp:/.cache \
274+
-v $$(pwd):$(DOCKER_REPO_ROOT) \
275+
-w $(DOCKER_REPO_ROOT) \
276+
--env HTTP_PROXY=$(HTTP_PROXY) \
277+
--env HTTPS_PROXY=$(HTTPS_PROXY) \
278+
$(BUILD_IMAGE) \
279+
chart-doc-gen -d ./charts/$*/doc.yaml -v ./charts/$*/values.yaml > ./charts/$*/README.md
280+
266281
.PHONY: manifests
267-
manifests: gen-crds patch-crds label-crds gen-bindata gen-values-schema
282+
manifests: gen-crds patch-crds label-crds gen-bindata gen-values-schema gen-chart-doc
268283

269284
.PHONY: gen
270285
gen: clientset gen-crd-protos manifests openapi

charts/stash-postgres/README.md

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,41 @@
11
# stash-postgres
22

3-
[stash-postgres](https://github.com/stashed/stash-postgres) - PostgreSQL database backup/restore plugin for [Stash by AppsCode](https://appscode.com/products/stash/).
3+
[stash-postgres](https://github.com/stashed/postgres) - PostgreSQL database backup/restore plugin for [Stash by AppsCode](https://stash.run)
44

55
## TL;DR;
66

77
```console
8-
helm repo add appscode https://charts.appscode.com/stable/
9-
helm repo update
10-
helm install stash-postgres-9.6 appscode/stash-postgres -n kube-system --version=9.6
8+
$ helm repo add appscode https://charts.appscode.com/stable/
9+
$ helm repo update
10+
$ helm install stash-postgres-9.6 appscode/stash-postgres -n kube-system --version=9.6
1111
```
1212

1313
## Introduction
1414

15-
This chart installs necessary `Function` and `Task` definition to backup or restore PostgreSQL database 9.6 using Stash.
15+
This chart deploys necessary `Function` and `Task` definition to backup or restore PostgreSQL database 9.6 using Stash on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
1616

1717
## Prerequisites
1818

1919
- Kubernetes 1.11+
2020

2121
## Installing the Chart
2222

23-
- Add AppsCode chart repository to your helm repository list,
23+
To install the chart with the release name `stash-postgres-9.6`:
2424

2525
```console
26-
helm repo add appscode https://charts.appscode.com/stable/
26+
$ helm install stash-postgres-9.6 appscode/stash-postgres -n kube-system --version=9.6
2727
```
2828

29-
- Update helm repositories to fetch latest charts from the remove repository,
29+
The command deploys necessary `Function` and `Task` definition to backup or restore PostgreSQL database 9.6 using Stash on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
3030

31-
```console
32-
helm repo update
33-
```
34-
35-
- Install the chart with the release name `stash-postgres-9.6` run the following command,
36-
37-
```console
38-
helm install stash-postgres-9.6 appscode/stash-postgres -n kube-system --version=9.6
39-
```
40-
41-
The above commands installs `Functions` and `Task` crds that are necessary to backup PostgreSQL database 9.6 using Stash.
31+
> **Tip**: List all releases using `helm list`
4232
4333
## Uninstalling the Chart
4434

45-
To uninstall/delete the `stash-postgres-9.6` run the following command,
35+
To uninstall/delete the `stash-postgres-9.6`:
4636

4737
```console
48-
helm uninstall stash-postgres-9.6 -n kube-system
38+
$ helm delete stash-postgres-9.6 -n kube-system
4939
```
5040

5141
The command removes all the Kubernetes components associated with the chart and deletes the release.
@@ -54,18 +44,26 @@ The command removes all the Kubernetes components associated with the chart and
5444

5545
The following table lists the configurable parameters of the `stash-postgres` chart and their default values.
5646

57-
| Parameter | Description | Default |
58-
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
59-
| `docker.registry` | Docker registry used to pull respective images | `stashed` |
60-
| `docker.image` | Docker image used to backup/restore PosegreSQL database | `stash-postgres` |
61-
| `docker.tag` | Tag of the image that is used to backup/restore PostgreSQL database. This is usually same as the database version it can backup. | `9.6` |
62-
| `backup.args` | Optional arguments to pass to `pgdump` command during bakcup process | |
63-
| `restore.args` | Optional arguments to pass to `psql` command during restore process | |
47+
| Parameter | Description | Default |
48+
|------------------|----------------------------------------------------------------------------------------------------------------------------------|------------------|
49+
| nameOverride | Overrides name template | `""` |
50+
| fullnameOverride | Overrides fullname template | `""` |
51+
| image.registry | Docker registry used to pull Postgres addon image | `stashed` |
52+
| image.repository | Docker image used to backup/restore PosegreSQL database | `stash-postgres` |
53+
| image.tag | Tag of the image that is used to backup/restore PostgreSQL database. This is usually same as the database version it can backup. | `"9.6"` |
54+
| backup.args | Arguments to pass to `pgdump` command during bakcup process | `""` |
55+
| restore.args | Arguments to pass to `psql` command during restore process | `""` |
56+
57+
58+
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example:
6459

65-
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
60+
```console
61+
$ helm install stash-postgres-9.6 appscode/stash-postgres -n kube-system --version=9.6 --set image.registry=stashed
62+
```
6663

67-
For example:
64+
Alternatively, a YAML file that specifies the values for the parameters can be provided while
65+
installing the chart. For example:
6866

6967
```console
70-
helm install stash-postgres-9.6 appscode/stash-postgres -n kube-system --set docker.registry=my-registry
68+
$ helm install stash-postgres-9.6 appscode/stash-postgres -n kube-system --version=9.6 --values values.yaml
7169
```

charts/stash-postgres/doc.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
project:
2+
name: stash-postgres
3+
shortName: stash-postgres
4+
url: https://github.com/stashed/postgres
5+
description: "PostgreSQL database backup/restore plugin for [Stash by AppsCode](https://stash.run)"
6+
app: "necessary `Function` and `Task` definition to backup or restore PostgreSQL database 9.6 using Stash"
7+
repository:
8+
url: https://charts.appscode.com/stable/
9+
name: appscode
10+
chart:
11+
name: stash-postgres
12+
version: "9.6"
13+
values: "-- generate from values file --"
14+
valuesExample: "-- generate from values file --"
15+
prerequisites:
16+
- Kubernetes 1.11+
17+
release:
18+
name: stash-postgres-9.6
19+
namespace: kube-system

charts/stash-postgres/values.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,23 @@
22
# This is a YAML-formatted file.
33
# Declare variables to be passed into your templates.
44

5+
# Overrides name template
56
nameOverride: ""
7+
# Overrides fullname template
68
fullnameOverride: ""
79

810
image:
11+
# Docker registry used to pull Postgres addon image
912
registry: stashed
13+
# Docker image used to backup/restore PosegreSQL database
1014
repository: stash-postgres
15+
# Tag of the image that is used to backup/restore PostgreSQL database.
16+
# This is usually same as the database version it can backup.
1117
tag: "9.6"
1218

13-
# optional argument to send pgdump or psql command
1419
backup:
20+
# Arguments to pass to `pgdump` command during bakcup process
1521
args: ""
1622
restore:
23+
# Arguments to pass to `psql` command during restore process
1724
args: ""

0 commit comments

Comments
 (0)