Skip to content

Commit

Permalink
Merge pull request #51 from Icinga/docs/CONTRIBUTING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mocdaniel authored May 6, 2024
2 parents 6e1c0ca + a855d38 commit dcd6e28
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
TODOS.md
__snapshot__/
__snapshot__/

# ignore downloaded dependencies (typically .tar.gz)
charts/icinga-stack/charts/
36 changes: 32 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,34 @@ Before contributing changes, please take a moment to review open/closed issues a

Once the issue has been opened and discussed, you can start working on your changes. Please fork the repository and create a new branch for your changes. Once you are done with your changes, please open a new pull request and reference the issue you created in the description.

### Templating the chart(s) locally

Charts can be templated locally using `helm template <path-to-chart` from `charts/icinga-stack`. It might be needed to install missing remote dependencies before doing so:

> [!NOTE]
> Some values might be required for templating to succeed.
> Simple dummy values are provided in [`charts/icinga-stack/tests/required-values.yaml`](./charts/icinga-stack/tests/required-values.yaml) for all charts.
```sh
$ cd charts/icinga-stack
$ helm dep update
$ helm template . -f tests/required-values.yaml > icinga-stack-manifests.yaml
$ helm template ./charts/icinga2 -f tests/required-values.yaml > icinga2-manifests.yaml
```

### Deploying the chart(s) locally

Charts can be installed and upgraded locally `helm install .` from their respective root directories:

> [!NOTE]
> Some values might be required for templating to succeed.
> Simple dummy values are provided in [`charts/icinga-stack/tests/required-values.yaml`](./charts/icinga-stack/tests/required-values.yaml) for all charts.
```sh
$ helm install <release> . -f tests/required-values.yaml
$ helm update <release> . -f tests/required-values.yaml
```

## Testing changes

For testing the charts in this repository, we use [helm-unittest](https://github.com/quintush/helm-unittest) and [Docker](https://docker.com). Please refer to the[helm-unittest documentation](https://github.com/quintush/helm-unittest) and [Docker documentation](https://docs.docker.com/get-docker/) for installation instructions.
Expand All @@ -35,7 +63,7 @@ This will test all the Helm templates in the `./templates/` directory against th

To maintain a certain style of tests throughout the charts, please adhere to the following conventions when writing new tests:

* Tests for subcharts should be placed in the `./tests` directory of the parent chart and prefixed with the subchart's name, e.g. `icingaweb2_deployment_test.yaml`.
* Tests should be grouped by the template they are testing.
* Test files should be named after the template they are testing, e.g. Icinga Web's `deployment.yaml` should be tested in `icingaweb2_deployment_test.yaml`.
* **Test Suites** should be prefixed with the name of the product/chart they test, e.g. *[Icinga 2] Test Icinga 2 persistence*
- Tests for subcharts should be placed in the `./tests` directory of the parent chart and prefixed with the subchart's name, e.g. `icingaweb2_deployment_test.yaml`.
- Tests should be grouped by the template they are testing.
- Test files should be named after the template they are testing, e.g. Icinga Web's `deployment.yaml` should be tested in `icingaweb2_deployment_test.yaml`.
- **Test Suites** should be prefixed with the name of the product/chart they test, e.g. _[Icinga 2] Test Icinga 2 persistence_
6 changes: 6 additions & 0 deletions charts/icinga-stack/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: common
repository: oci://registry-1.docker.io/bitnamicharts
version: 2.19.2
digest: sha256:e8815a21c72dd685b5573d0baeeeff733db3bc6d77b30c95a78ff316188e8a65
generated: "2024-05-06T15:03:37.600822+02:00"

0 comments on commit dcd6e28

Please sign in to comment.