diff --git a/.woodpecker/build-package.yml b/.woodpecker/build-package.yml index 6b5f1b9..33551d9 100644 --- a/.woodpecker/build-package.yml +++ b/.woodpecker/build-package.yml @@ -10,7 +10,6 @@ steps: image: quay.io/thegeeklab/kube-tools commands: - make - - cat dist/helm.toolkit.fluxcd.io/all-anyOf.json - name: publish image: quay.io/thegeeklab/wp-git-action diff --git a/templates/all.json.tmpl b/templates/all.json.tmpl index 5829359..919273e 100644 --- a/templates/all.json.tmpl +++ b/templates/all.json.tmpl @@ -1,14 +1,17 @@ { "{{ ds "type" }}": [ {{- $path := ds "source" }} - {{- $filelist := file.ReadDir $path }} - {{- $length := len $filelist}} - {{- range $i, $item := $filelist }} + {{- $filelist := coll.Slice }} + {{- range $item := file.ReadDir $path }} + {{- if $item | strings.HasPrefix "all-" }}{{ continue }}{{ end }} + {{- $filelist = $filelist | coll.Append $item }} + {{- end }} + {{- $last := sub (len $filelist) 1 }} + {{- range $i, $item := $filelist | coll.Sort }} {{- if $item | strings.HasPrefix "all-" }}{{ continue }}{{ end }} - {{- if $i }},{{ end }} { "$ref": "https://gitea.rknet.org/infra/crds-catalog/raw/branch/catalog/{{ $path | path.Base }}/{{ $item }}" - } + }{{ if ne $i $last }},{{ end }} {{- end }} ] }