Flakify lib, sas

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-08-17 16:47:20 +03:00
parent 4129589665
commit 795ea28583
22 changed files with 110 additions and 98 deletions

21
scripts/update-keys.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
find . -type f -name 'sops.yaml' | while IFS= read -r sops_file; do
dir=$(dirname "$sops_file")
namespace=$(grep -A1 "namespaces:" "$sops_file" | tail -n1 | awk '{print $2}' | tr -d '&')
SOPS_AGE_KEY_FILE="./secrets/$namespace/key.txt"
export SOPS_AGE_KEY_FILE
find "$dir" -maxdepth 1 -type f -regextype posix-extended \
-regex '.+\.(yaml|yml|json|env|ini|bin)' \
! -name 'sops.yaml' | while IFS= read -r file; do
sops --config "$sops_file" updatekeys "$file" -y
done
unset SOPS_AGE_KEY_FILE
done