Helmfile exec examples

 {{- range $_, $file := ( exec "bash" ( list "-c" (printf "echo -n %s/%s/*dash*.json" .Values.grafana.backupdir .Environment.Name)) | splitList " ") }}
 {{$test:="not"}}
 {{/*$test:= (exec "bash" ( list "-c" "test" "-f" (printf "%s" $file) "; echo $?") ) */}}
 {{ if eq $test "ok" }}
 {{ regexReplaceAll ".*/" $file "" | indent 3 }}:
 json: {{ readFile $file | toJson }}
 {{- end -}}
 {{- end -}}

var_dump
{{ $| mustToPrettyJson | printf "\nThe JSON output of the dumped var is: \n%s" | fail }}

resources:
  {{- range $_, $file := ( exec "bash" (list "-c" "echo -n ../resources/*") | splitList " " ) }}
  - {{ $ | tpl (readFile $file)  | nindent 4 }}
  {{ end }}

{{- $json := exec "helmfile" (list "-e" "some-env" "list" "--file" "../../../helmfile.yaml" "--disable-force-update" "--skip-charts" "--output" "json" "2>&1") | fromJson }}

Комментарий:

Powered by emlog