New 🌊 wave for @helm

Commit 80f51e69

80f51e697e24Merged

Дмитрий Жиляев <[email protected]> · 6 years ago · 5 files · +1 added · ~4 modified

Description

yaml

Details

Commit
80f51e697e24
Parent
64f8e4083908

README.mdmodifiedView file

@@ -11,8 +11,8 @@
1111 - `$ wget -o ...`
1212 - `$ curl -o ...`
1313 - Run as a container
14- - `$ docker run diamon/helmwave:0.1.4`
15- - `$ docker run --entrypoint=ash -it --rm --name helmwave diamon/helmwave:0.1.4`
14+ - `$ docker run diamon/helmwave:0.1.5`
15+ - `$ docker run --entrypoint=ash -it --rm --name helmwave diamon/helmwave:0.1.5`
1616
1717 ### Build
1818
@@ -34,7 +34,7 @@
3434
3535 ```yaml
3636 project: my-project
37-version: 0.1.4
37+version: 0.1.5
3838
3939
4040 repositories:
@@ -86,7 +86,7 @@
8686
8787 ```yaml
8888 project: my-project
89-version: 0.1.4
89+version: 0.1.5
9090
9191
9292 repositories:
@@ -159,7 +159,7 @@
159159 helmwave [global options] command [command options] [arguments...]
160160
161161 VERSION:
162- 0.1.4
162+ 0.1.5
163163
164164 DESCRIPTION:
165165 🏖 This tool helps you compose your helm releases!
@@ -192,7 +192,7 @@
192192
193193 ```yaml
194194 project: {{ env "CI_PROJECT_NAME" }}
195-version: 0.1.4
195+version: 0.1.5
196196
197197
198198 repositories:
@@ -224,7 +224,7 @@
224224
225225 ```yaml
226226 project: my-project
227-version: 0.1.4
227+version: 0.1.5
228228
229229
230230 repositories:
@@ -255,7 +255,7 @@
255255
256256 ```yaml
257257 project: my-project
258- version: 0.1.4
258+ version: 0.1.5
259259 repositories:
260260 - name: bitnami
261261 url: https://charts.bitnami.com/bitnami
@@ -348,12 +348,90 @@
348348 Helmwave supports all built-in functions, [Sprig library](https://godoc.org/github.com/Masterminds/sprig), and several advanced functions:
349349 - `toYaml` marshals a map into a string
350350 - `fromYaml` reads a golang string and generates a map
351+- `readFile` get file as string
351352 - `get` (Sprig's original `get` is available as `sprigGet`)
352353 - `setValueAtPath` PATH NEW_VALUE traverses a golang map, replaces the value at the PATH with NEW_VALUE
353354 - `requiredEnv` The requiredEnv function allows you to declare a particular environment variable as required for template rendering. If the environment variable is unset or empty, the template rendering will fail with an error message.
354355
355356 I am working for added more functions.
356357
358+#### readFile
359+
360+<details>
361+ <summary>my-releases.yml</summary>
362+
363+ ```yaml
364+releases:
365+ - name: redis
366+ repo: bitnami
367+ - name: memcached
368+ repo: bitnami
369+ ```
370+</details>
371+
372+<details>
373+ <summary>helmwave.yml.tpl</summary>
374+
375+ ```yaml
376+ project: my
377+ version: 0.1.5
378+
379+
380+ repositories:
381+ - name: bitnami
382+ url: https://charts.bitnami.com/bitnami
383+
384+
385+ .global: &global
386+ install: true
387+
388+
389+ releases:
390+ {{- with readFile "my-releases.yml" | fromYaml | get "releases" }}
391+ {{- range $v := . }}
392+ - name: {{ $v | get "name" }}
393+ chart: {{ $v | get "repo" }}/{{ $v | get "name" }}
394+ options:
395+ <<: *global
396+ {{- end }}
397+ {{- end }}
398+ ```
399+
400+</details>
401+
402+```bash
403+$ helmwave render
404+```
405+
406+<details>
407+ <summary>helmwave.yml</summary>
408+
409+ ```yaml
410+ project: my
411+ version: 0.1.5
412+
413+ repositories:
414+ - name: bitnami
415+ url: https://charts.bitnami.com/bitnami
416+
417+ .global: &global
418+ install: true
419+
420+ releases:
421+ - name: redis
422+ chart: bitnami/redis
423+ options:
424+ <<: *global
425+ - name: memcached
426+ chart: bitnami/memcached
427+ options:
428+ <<: *global
429+ ```
430+
431+</details>
432+
433+
434+
357435 ## 🚀 Features
358436
359437 - [x] Helm release is working via official golang module [helm](https://github.com/helm/helm/tree/master/pkg)