Skip to content

Commit

Permalink
Release 0.1.0 (#9)
Browse files Browse the repository at this point in the history
Release 0.1.0
  • Loading branch information
oliverbaehler authored Sep 9, 2022
1 parent 95a66ca commit c7f6423
Show file tree
Hide file tree
Showing 264 changed files with 10,148 additions and 2,747 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
# Reference: https://github.com/helm/chart-testing-action
#
name: Linting and Testing
on: pull_request
on:
pull_request:
branches:
- main
jobs:
chart-test:
chart-test:
runs-on: ubuntu-latest
strategy:
matrix:
helm-version: [ 'v3.5.4', 'v3.6.3', 'v3.7.1', 'v3.8.2', 'latest' ]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -14,6 +20,8 @@ jobs:

- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: '${{ matrix.helm-version }}'

- uses: actions/setup-python@v2
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -32,6 +34,7 @@ jobs:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

deploy:
needs: release
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
79 changes: 79 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Contributing Guidelines

We'd love to accept your patches and contributions to this project. There are just a few small guidelines you need to follow.

# How to Contribute

With these steps you can make a contribution:

1. Fork this repository, develop and test your changes on that fork.
2. All commits have a meaningful description and are signed off as described above.
3. Submit a pull request from your fork to this project.

## Code reviews

All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more information on using pull requests. See the above stated requirements for PR on this project.

## Technical Requirements

Your PR has to fulfill the following points, to be considered:

* All Workflows must pass
* DCO Check must pass
* The title of the PR starts with the chart name (e.g. `[chart_name]: Additional options for SecurityContext`)
* Changes must follow [Helm best practices](https://helm.sh/docs/chart_best_practices/).
* Changes to a chart require a version bump for that chart following [semver standard](https://semver.org/).
* New/Changed Configurations for the chart are documented in it's `README.md.gotmpl` file.

# Chart Requirements

There are certain requirements charts have to match, to be maintained in your Helm Repository. Most of the requirements are relevant when you are planning to add a new chart to the repository.

## Documentation

The documentation for each chart is done with [helm-docs](https://github.com/norwoodj/helm-docs). This way we can ensure that values are consistent with the chart documentation:

```
make helm-docs
```
### Upgrades

If your chart requires manual interaction for version upgrades (might be the case for major upgrades) you need to mention the exact instructions in a dedicated documentation part of your chart. That's not the case for upgrades, where no specific interaction is required.

## Dependencies

Dependency versions should be set to a fixed version. We allow version fixing over all bugfix versions (eg. `~1.0.0`), since bugfix releases should not have big impact.

```
dependencies:
- name: "apache"
version: "~1.3.0"
repository: "https://charts.bitnami.com/bitnami"
```

There might be cases where this rule can not be applied, we are open to discuss that.


## ArtifactHub Annotations

Since we release our charts on [Artifacthub](https://artifacthub.io/) we encourage making use of the provided chart annotations for Artifacthub.

* [All Artifacthub Annotations](https://github.com/artifacthub/hub/blob/master/docs/helm_annotations.md)

In some cases they might not be required.

### Changelog

Changes on a chart must be documented in a chart specific changelog. For every new release the entire ```artifacthub.io/changes``` needs to be rewritten. Each change requires a new bullet point following the pattern `- "[{type}]: {description}"`. Please use the following template:


```
artifacthub.io/changes: |
- "[Added]: Something New was added"
- "[Changed]: Changed Something within this chart"
- "[Changed]: Changed Something else within this chart"
- "[Deprecated]: Something deprecated"
- "[Removed]: Something was removed"
- "[Fixed]: Something was fixed"
- "[Security]": Some Security Patch was included"
```
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Helm
SRC_ROOT = $(shell git rev-parse --show-toplevel)

helm-docs: HELMDOCS_VERSION := v1.11.0
helm-docs: docker
@docker run -v "$(SRC_ROOT):/helm-docs" jnorwood/helm-docs:$(HELMDOCS_VERSION) --chart-search-root /helm-docs

lint: docker
@docker run -v "$(SRC_ROOT):/workdir" --entrypoint /bin/sh quay.io/helmpack/chart-testing:v3.3.1 -c cd /workdir && ct lint --config ./charts/ct.yaml --lint-conf ./charts/lint.yaml --all --debug
@docker run -v "$(SRC_ROOT):/workdir" --entrypoint /bin/sh quay.io/helmpack/chart-testing:v3.3.1 -c cd /workdir && ct lint --config ./examples/ct.yaml --all --debug

unit-test: docker

docker:
@hash docker 2>/dev/null || {\
echo "You need docker" &&\
exit 1;\
}
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
# helmize
Helmize Documentation Repository
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/helmize)](https://artifacthub.io/packages/search?repo=helmize)

<img src="hugo/icon/icon.png"
alt="Markdown Monster icon"
style="float: right; width:200px;margin-right: 10px;" />

# Helmize

Helmize is just a simple chart library which simplifies creating complex infrastructure deployments within helm charts. It's a powerful extension for which integrates into existing GitOps Toolskits. It's just a helm library..

## Documentation

The entire documentation can be found here:

* [helmize.dev](https://helmize.dev)

## Contributing

We'd love to have you contribute! Please refer to our [contribution guidelines](CONTRIBUTING.md) for details.
10 changes: 5 additions & 5 deletions charts/helmize/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apiVersion: v2
name: helmize
description: Go Sprig based deployment engine deployed via Helm
description: Go Sprig based deployment engine (GitOps Tool)
type: library
version: "0.1.0-rc.4"
version: "0.1.0"
appVersion: "0.1.0"
home: https://helmize.dev
icon: https://raw.githubusercontent.com/buttahtoast/helmize/main/icon.png
icon: https://raw.githubusercontent.com/buttahtoast/helmize/main/hugo/icon/icon.png
dependencies:
- name: library
version: "2.2.3"
version: "3.0.0-rc.3"
repository: https://buttahtoast.github.io/helm-charts/
keywords:
- library
Expand All @@ -18,4 +18,4 @@ maintainers:
- name: oliverbaehler
email: [email protected]
annotations:
artifacthub.io/prerelease: "true"
artifacthub.io/prerelease: "false"
8 changes: 3 additions & 5 deletions charts/helmize/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# Helmize

![Version: 0.1.0-rc.1](https://img.shields.io/badge/Version-0.1.0--rc.1-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)

Helmize is a simple deployment library wrapped in a library helm chart. It's purpose is to simplify complex infrastructure deployments where you change deployed manifests based on given conditions. This project is thought for people that bootstrap complex infrastructure setup on kubernetes and want to simplify their file structure.

**NOTE**: This project is in it's early stages of development. The code might be subject to change. However we are trying not to change the entire structure or config. Feel free to test it out, we need user feedback. :) Using it in production is your choice and your responsability.

Read the entire documentation on the homepage.

**Homepage:** <https://buttahtoast.github.io/helmize/>
**Homepage:** <https://helmize.dev>

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| oliverbaehler | [email protected] | |
| oliverbaehler | <[email protected]> | |
2 changes: 0 additions & 2 deletions charts/helmize/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

Helmize is a simple deployment library wrapped in a library helm chart. It's purpose is to simplify complex infrastructure deployments where you change deployed manifests based on given conditions. This project is thought for people that bootstrap complex infrastructure setup on kubernetes and want to simplify their file structure.

**NOTE**: This project is in it's early stages of development. The code might be subject to change. However we are trying not to change the entire structure or config. Feel free to test it out, we need user feedback. :) Using it in production is your choice and your responsability.

Read the entire documentation on the homepage.

{{ template "chart.homepageLine" . }}
Expand Down
50 changes: 50 additions & 0 deletions charts/helmize/templates/_deploy.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{{/* Deploy <Template>
Returns deployable kubernetes manifests. If any errors are found the template errrors
*/}}
{{- define "helmize.deploy" -}}

{{/* Print Helmize Configuration */}}
{{- if ((fromYaml (include "lib.utils.dicts.get" (dict "data" $.Values "path" (include "helmize.render.defaults.show_config" $)))).res) -}}
{{- toYaml (dict "config" (fromYaml (include "helmize.config.func.get" $))) | nindent 0 }}

{{/* Resolve Train */}}
{{- else -}}

{{/* Summary Output (Dedicated Call, Since SUmmary also resolves and serves as standalone template) */}}
{{- if ((fromYaml (include "lib.utils.dicts.get" (dict "data" $.Values "path" (include "helmize.render.defaults.summary_value" $)))).res) -}}
{{- include "helmize.render.func.summary" $ -}}

{{- else -}}
{{/* Resolve */}}
{{- $train_raw := include "helmize.render.func.resolve" $ -}}
{{- $train := fromYaml ($train_raw) -}}

{{/* Check for YAML errors */}}
{{- if (not (include "lib.utils.errors.unmarshalingError" $train)) -}}

{{/* Get Force Option */}}
{{- $force := ((fromYaml (include "helmize.config.func.resolve" (dict "path" (include "helmize.config.defaults.force" $) "ctx" $))).res) -}}

{{/* Check if Errors were found (Or Force enabled) */}}
{{- if or (not $train.errors) (and ($train.errors) ($force)) -}}

{{/* Benchmark Output */}}
{{- if ((fromYaml (include "lib.utils.dicts.get" (dict "data" $.Values "path" (include "helmize.render.defaults.benchmark_value" $)))).res ) -}}
{{- include "lib.utils.errors.fail" (printf "Exectuion Benchmarks:\n%s" (toYaml $train.timestamps | nindent 2)) -}}

{{/* Render */}}
{{- else -}}
{{- include ((fromYaml (include "helmize.config.func.resolve" (dict "path" (include "helmize.config.defaults.render_template" $) "ctx" $))).res) (dict "ctx" $ "train" $train) -}}
{{- end -}}

{{- else -}}
{{- include "lib.utils.errors.fail" (printf "Found errors, please resolve those errors or use the force option (--set helmize.force=true):\n%s" (toYaml $train.errors | nindent 2)) -}}
{{- end -}}
{{- else -}}
{{- include "lib.utils.errors.fail" (printf "Render did not return valid YAML:\n%s" ($train_raw | nindent 2)) -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
7 changes: 7 additions & 0 deletions charts/helmize/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{- define "helmize.helpers.ts" -}}
{{- $_ := set $.ctx "timestamps" (append $.ctx.timestamps (dict "point" $.msg "time" now)) -}}
{{- end -}}

{{- define "helmize.helpers.trailingPath" -}}
{{- printf "%s" ($ | trimPrefix "/" | trimPrefix "./" | trimSuffix "/") -}}
{{- end -}}
100 changes: 90 additions & 10 deletions charts/helmize/templates/conditions/_defaults.tpl
Original file line number Diff line number Diff line change
@@ -1,18 +1,98 @@
{{/* Name (Conditions Type) <Template>
{{/* Conditions <Template>
Name Configuration Key
Default Configuration Key within configuration file for conditions option
*/}}
{{- define "helmize.conditions.defaults.conditions.name" -}}
name
{{- end -}}


{{/* Key (Conditions Type) <Template>
Key Configuration Key
*/}}
{{- define "helmize.conditions.defaults.conditions.key" -}}
key
{{- end -}}


{{/* Key Types (Conditions Type) <Template>
Key Types Configuration Key
*/}}
{{- define "helmize.conditions.defaults.conditions.key_types" -}}
key_types
{{- end -}}


{{/* Filter (Conditions Type) <Template>
Filter Configuration Key
*/}}
{{- define "helmize.conditions.defaults.conditions.filter" -}}
filter
{{- end -}}


{{/* Any (Conditions Type) <Template>
Any Configuration Key
*/}}
{{- define "helmize.conditions.defaults.conditions.any" -}}
any
{{- end -}}


{{/* Path (Conditions Type) <Template>
Key Types Configuration Key
*/}}
{{- define "helmize.conditions.defaults.conditions.path" -}}
path
{{- end -}}


{{/* Required (Conditions Type) <Template>
Required Configuration Key
*/}}
{{- define "helmize.conditions.defaults.conditions.required" -}}
required
{{- end -}}


{{/* Default (Conditions Type) <Template>
Default Configuration Key
*/}}
{{- define "helmize.conditions.defaults.conditions.default" -}}
default
{{- end -}}


{{/* Data (Conditions Type) <Template>
Data Configuration Key
*/}}
{{- define "inventory.conditions.defaults.conditions" -}}
conditions
{{- end }}
{{- define "helmize.conditions.defaults.conditions.data" -}}
data
{{- end -}}


{{/* Inventory Directory <Template>
{{/* Templates (Conditions Type) <Template>
Default Configuration Key within configuration file for inventory directory option
Templates Configuration Key
*/}}
{{- define "inventory.conditions.defaults.inv_dir" -}}
inventory_directory
{{- end }}
{{- define "helmize.conditions.defaults.conditions.tpls" -}}
tpls
{{- end -}}
Loading

0 comments on commit c7f6423

Please sign in to comment.