mirror of
https://github.com/vhaudiquet/homeprod.git
synced 2025-12-18 20:16:05 +00:00
Add SOPS encryption for env files
(and decryption with SwarmCD)
This commit is contained in:
@@ -17,8 +17,16 @@ find docker -name 'docker-compose.yml' -print0 \
|
||||
| sort \
|
||||
| while read -r dir; do
|
||||
file="$dir/docker-compose.yml"
|
||||
|
||||
# Discover env file if it exists, and add it to secret list
|
||||
if [ -f "$dir/.env" ]; then
|
||||
env=" sops_files:\n - $dir/.env\n"
|
||||
else
|
||||
env=""
|
||||
fi
|
||||
|
||||
name=$(basename "$dir")
|
||||
echo -e "$name:\n repo: homeprod\n branch: main\n compose_file: $file\n" >> "$tmpfile"
|
||||
echo -e "$name:\n repo: homeprod\n branch: main\n compose_file: $file\n$env" >> "$tmpfile"
|
||||
done
|
||||
|
||||
# Overwrite file on change
|
||||
|
||||
Reference in New Issue
Block a user