Skip to content

Commit 4cc04fb

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

File tree

4 files changed

+73
-32
lines changed

4 files changed

+73
-32
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_stashmongodbs.yaml spec.validation.openAPIV3Schema.properties.spec > /tmp/stash-mongodb-values.openapiv3_schema.yaml
264264
@yq d /tmp/stash-mongodb-values.openapiv3_schema.yaml description > charts/stash-mongodb/values.openapiv3_schema.yaml
265265

266+
.PHONY: gen-chart-doc
267+
gen-chart-doc: gen-chart-doc-stash-mongodb
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-mongodb/README.md

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

3-
[stash-mongodb](https://github.com/stashed/stash-mongodb) - MongoDB database backup/restore plugin for [Stash by AppsCode](https://appscode.com/products/stash/).
3+
[stash-mongodb](https://github.com/stashed/mongodb) - MongoDB 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-mongodb-4.1.7 appscode/stash-mongodb -n kube-system --version=4.1.7
8+
$ helm repo add appscode https://charts.appscode.com/stable/
9+
$ helm repo update
10+
$ helm install stash-mongodb-4.1.7 appscode/stash-mongodb -n kube-system --version=4.1.7
1111
```
1212

1313
## Introduction
1414

15-
This chart installs necessary `Function` and `Task` definition to backup or restore MongoDB database 4.1.7 using Stash.
15+
This chart deploys necessary `Function` and `Task` definition to backup or restore MongoDB database 4.1.7 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-mongodb-4.1.7`:
2424

2525
```console
26-
helm repo add appscode https://charts.appscode.com/stable/
26+
$ helm install stash-mongodb-4.1.7 appscode/stash-mongodb -n kube-system --version=4.1.7
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 MongoDB database 4.1.7 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-mongodb-4.1.7` run the following command,
36-
37-
```console
38-
helm install stash-mongodb-4.1.7 appscode/stash-mongodb -n kube-system --version=4.1.7
39-
```
40-
41-
The above commands installs `Functions` and `Task` crds that are necessary to backup MongoDB database 4.1.7 using Stash.
31+
> **Tip**: List all releases using `helm list`
4232
4333
## Uninstalling the Chart
4434

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

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

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

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

57-
| Parameter | Description | Default |
58-
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------- | --------------- |
59-
| `image.registry` | Docker registry used to pull respective images | `stashed` |
60-
| `image.repository` | Docker image used to backup/restore MongoDB database | `stash-mongodb` |
61-
| `image.tag` | Tag of the image that is used to backup/restore MongoDB database. This is usually same as the database version it can backup. | `4.1.7` |
62-
| `backup.args` | Optional arguments to pass to `mongodump` command during bakcup process | |
63-
| `restore.args` | Optional arguments to pass to `mongorestore` 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 MongoDB addon image | `stashed` |
52+
| image.repository | Docker image used to backup/restore MongoDB database | `stash-mongodb` |
53+
| image.tag | Tag of the image that is used to backup/restore MongoDB database. This is usually same as the database version it can backup. | `"4.1.7"` |
54+
| backup.args | Arguments to pass to `mongodump` command during bakcup process | `""` |
55+
| restore.args | Arguments to pass to `mongorestore` command during restore process | `""` |
56+
| maxConcurrency | Maximum concurrency to perform backup or restore tasks | `3` |
57+
58+
59+
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example:
6460

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

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

6968
```console
70-
helm install stash-mongodb-4.1.7 appscode/stash-mongodb -n kube-system --set docker.registry=my-registry
69+
$ helm install stash-mongodb-4.1.7 appscode/stash-mongodb -n kube-system --version=4.1.7 --values values.yaml
7170
```

charts/stash-mongodb/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-mongodb
3+
shortName: stash-mongodb
4+
url: https://github.com/stashed/mongodb
5+
description: "MongoDB database backup/restore plugin for [Stash by AppsCode](https://stash.run)"
6+
app: "necessary `Function` and `Task` definition to backup or restore MongoDB database 4.1.7 using Stash"
7+
repository:
8+
url: https://charts.appscode.com/stable/
9+
name: appscode
10+
chart:
11+
name: stash-mongodb
12+
version: "4.1.7"
13+
values: "-- generate from values file --"
14+
valuesExample: "-- generate from values file --"
15+
prerequisites:
16+
- Kubernetes 1.11+
17+
release:
18+
name: stash-mongodb-4.1.7
19+
namespace: kube-system

charts/stash-mongodb/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,26 @@
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 MongoDB addon image
912
registry: stashed
13+
# Docker image used to backup/restore MongoDB database
1014
repository: stash-mongodb
15+
# Tag of the image that is used to backup/restore MongoDB database.
16+
# This is usually same as the database version it can backup.
1117
tag: "4.1.7"
1218

1319
# optional argument to send mongodump or mongorestore command
1420
backup:
21+
# Arguments to pass to `mongodump` command during bakcup process
1522
args: ""
1623
restore:
24+
# Arguments to pass to `mongorestore` command during restore process
1725
args: ""
1826

1927
# Maximum concurrency to perform backup or restore tasks

0 commit comments

Comments
 (0)