Improve contribution part of this repository (#328)

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/328
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: justusbunsi <justusbunsi@noreply.gitea.io>
Co-committed-by: justusbunsi <justusbunsi@noreply.gitea.io>
This commit is contained in:
justusbunsi 2022-06-13 03:35:24 +08:00 committed by techknowlogick
parent b3b91e2044
commit 2cc3195eaa
12 changed files with 863 additions and 38 deletions

View File

@ -10,24 +10,26 @@ platform:
steps:
- name: helm lint
pull: always
image: alpine:3.15
image: alpine:3.16
commands:
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
- helm lint
- name: helm template
pull: always
image: alpine:3.15
image: alpine:3.16
commands:
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
- helm dependency update
- helm template --debug gitea-helm .
- name: markdown lint
- name: verify readme
pull: always
image: docker.io/volkerraschek/markdownlint:latest
image: alpine:3.16
commands:
- markdownlint *.md
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing make npm git
- make readme
- git diff --exit-code --name-only README.md
- name: discord
pull: always
@ -58,7 +60,7 @@ trigger:
steps:
- name: generate-chart
pull: always
image: alpine:3.15
image: alpine:3.16
commands:
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm
- apk add --no-cache curl

View File

@ -0,0 +1,41 @@
<!--
Before you open the request please review the following guidelines and tips to help it be more easily integrated:
- Describe the scope of your change - i.e. what the change does.
- Describe any known limitations with your change.
- Please run any tests or examples that can exercise your modified code.
Thank you for contributing! We will try to review, test and integrate the change as soon as we can.
-->
### Description of the change
<!-- Describe the scope of your change - i.e. what the change does. -->
### Benefits
<!-- What benefits will be realized by the code change? -->
### Possible drawbacks
<!-- Describe any known limitations with your change -->
### Applicable issues
<!-- Enter any applicable Issues here (You can reference an issue using #). Please remove this section if there is no referenced issue. -->
- fixes #
### Additional information
<!-- If there's anything else that's important and relevant to your pull request, mention that information here. Please remove this section if it remains empty. -->
### ⚠ BREAKING
<!-- If there's a breaking change, please shortly describe in which way users are affected and how they can mitigate it. If there are no breakings, please remove this section. -->
### Checklist
<!-- [Place an '[X]' (no spaces) in all applicable fields. Please remove unrelated fields.] -->
- [ ] Parameters are documented in the `values.yaml` and added to the `README.md` using [readme-generator-for-helm](https://github.com/bitnami-labs/readme-generator-for-helm)
- [ ] Breaking changes are documented in the `README.md`

3
.gitignore vendored
View File

@ -1,3 +1,4 @@
charts
charts/
node_modules/
Chart.lock
.DS_Store

View File

@ -20,5 +20,8 @@
.idea/
*.tmproj
.vscode/
#charts/
#Chart.lock
node_modules/
.npmrc
package.json
package-lock.json
.gitea/

3
.markdownlintignore Normal file
View File

@ -0,0 +1,3 @@
.gitea/
node_modules/
charts/

1
.npmrc Normal file
View File

@ -0,0 +1 @@
engine-strict=true

52
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,52 @@
# Contribution Guidelines
Any type of contribution is welcome; from new features, bug fixes, tests,
refactorings for easier maintainability or documentation improvements.
## Development environment
- [`node`](https://nodejs.org/en/) at least current LTS
- [`helm`](https://helm.sh/docs/intro/install/)
- `make` is optional; you may call the commands directly
When using Visual Studio Code as IDE, following plugins might be useful:
- [Markdown All in One](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one)
- [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint)
- [Helm Intellisense](https://marketplace.visualstudio.com/items?itemName=Tim-Koehler.helm-intellisense)
## Documentation Requirements
The `README.md` must include all configuration options. The parameters section
is generated by extracting the parameter annotations from the `values.yaml` file,
by using [this tool](https://github.com/bitnami-labs/readme-generator-for-helm).
If changes were made on configuration options, run `make readme` to update the
README file.
## Pull Request Requirements
When submitting or updating a PR:
- make sure it passes CI builds.
- do not make independent changes in one PR.
- try to avoid rebases. They make code reviews for large PRs and comments much harder.
- if applicable, use the PR template for a well-defined PR description.
- clearly mark breaking changes.
## Local development & testing
For local development and testing of pull requests, the following workflow can
be used:
1. Install `minikube` and `helm`.
2. Start a `minikube` cluster via `minikube start`.
3. From the `gitea/helm-chart` directory execute the following command. This
will install the dependencies listed in `Chart.yml` and deploy the current
state of the helm chart found locally. If you want to test a branch, make
sure to switch to the respective branch first.
`helm install --dependency-update gitea . -f values.yaml`.
4. Gitea is now deployed in `minikube`. To access it, it's port needs to be
forwarded first from `minikube` to localhost first via `kubectl --namespace
default port-forward svc/gitea-http 3000:3000`. Now Gitea is accessible at
[http://localhost:3000](http://localhost:3000).

View File

@ -1,15 +1,8 @@
readme: helm-doc
readme-generator -v values.yaml -r README.md
markdownlint *.md -f
.PHONY: prepare-environment
prepare-environment:
npm install
.PHONY: helm-doc
helm-doc:
ifeq (, $(shell which readme-generator))
@{ \
set -e ;\
echo 'installing readme-generator-for-helm' ;\
npm install -g readme-generator-for-helm ;\
}
else
echo 'readme-generator-for-helm is already installed'
endif
.PHONY: readme
readme: prepare-environment
npm run readme:parameters
npm run readme:lint

View File

@ -927,19 +927,8 @@ gitea:
| ------------------ | ---------------------------------------------------- | ------ |
| `checkDeprecation` | Set it to false to skip this basic validation check. | `true` |
## Local development & testing
## Contributing
For local development and testing of pull requests, the following workflow can
be used:
Expected workflow is: Fork -> Patch -> Push -> Pull Request
1. Install `minikube` and `helm`.
2. Start a `minikube` cluster via `minikube start`.
3. From the `gitea/helm-chart` directory execute the following command. This
will install the dependencies listed in `Chart.yml` and deploy the current
state of the helm chart found locally. If you want to test a branch, make
sure to switch to the respective branch first.
`helm install --dependency-update gitea . -f values.yaml`.
4. Gitea is now deployed in `minikube`. To access it, it's port needs to be
forwarded first from `minikube` to localhost first via `kubectl --namespace
default port-forward svc/gitea-http 3000:3000`. Now Gitea is accessible at
[http://localhost:3000](http://localhost:3000).
See [CONTRIBUTORS GUIDE](CONTRIBUTING.md) for details.

721
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

19
package.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "gitea-helm-chart",
"homepage": "https://gitea.com/gitea/helm-chart.git",
"license": "MIT",
"private": true,
"engineStrict": true,
"engines": {
"node": ">=16.0.0",
"npm": ">=8.0.0"
},
"scripts": {
"readme:lint": "markdownlint *.md -f",
"readme:parameters": "readme-generator -v values.yaml -r README.md"
},
"devDependencies": {
"markdownlint-cli": "^0.31.1",
"readme-generator-for-helm": "https://github.com/bitnami-labs/readme-generator-for-helm/tarball/main"
}
}

View File

@ -389,7 +389,7 @@ gitea:
## @section Memcached
#
## @param memcached.enabled Memcached is loaded as a dependency from [Bitnami](https://github.com/bitnami/charts/tree/master/bitnami/memcached) if enabled in the values. Complete Configuration can be taken from their website.
## @param memcached.service.port Port for memcached
## @param memcached.service.port Port for Memcached
memcached:
enabled: true
service: