new initcontainer
This commit is contained in:
@@ -1964,7 +1964,7 @@ spec:
|
||||
fsGroup: 1000
|
||||
initContainers:
|
||||
- name: build-bookmarks-index
|
||||
image: mikefarah/yq:4
|
||||
image: ghcr.io/mikefarah/yq:4.44.3
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
@@ -1972,34 +1972,37 @@ spec:
|
||||
command: ["/bin/sh", "-c"]
|
||||
args:
|
||||
- |
|
||||
set -e
|
||||
set -eux
|
||||
which yq
|
||||
yq --version
|
||||
|
||||
mkdir -p /app/assets
|
||||
|
||||
# 1) Extract all bookmark links into JSON (raw fields)
|
||||
yq -o=json '
|
||||
yq eval -o=json '
|
||||
[ .pages[] as $p
|
||||
| .columns[]? as $c
|
||||
| $p.columns[]? as $c
|
||||
| $c.widgets[]? as $w
|
||||
| select($w.type == "bookmarks")
|
||||
| $w.groups[]? as $g
|
||||
| $g.links[]?
|
||||
| select(.url != null and .url != "")
|
||||
| {
|
||||
title: (.title // ""),
|
||||
url: .url,
|
||||
page: ($p.name // ""),
|
||||
widget: ($w.title // ""),
|
||||
group: ($g.title // "")
|
||||
"title": (.title // .url),
|
||||
"url": .url,
|
||||
"page": ($p.name // ""),
|
||||
"widget": ($w.title // ""),
|
||||
"group": ($g.title // "")
|
||||
}
|
||||
]
|
||||
' /config/glance.yml \
|
||||
| yq -o=json '
|
||||
map(.title = (if .title == "" then .url else .title end))
|
||||
| unique_by(.url)
|
||||
' - \
|
||||
> /app/assets/bookmarks.json
|
||||
] | unique_by(.url)
|
||||
' /config/glance.yml > /app/assets/bookmarks.json
|
||||
|
||||
echo "Bookmarks indexed: $(yq -r 'length' /app/assets/bookmarks.json)"
|
||||
echo "Bookmarks indexed: $(yq eval -r 'length' /app/assets/bookmarks.json)"
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /config
|
||||
readOnly: true
|
||||
- name: assets
|
||||
mountPath: /app/assets
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /config
|
||||
|
||||
Reference in New Issue
Block a user