Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update contributor documentation with local build + instal instructions #51

Merged
merged 2 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"