Add sops taskfile

This commit is contained in:
Joseph Hanson 2024-05-14 12:48:04 -05:00
parent 0a1255b438
commit c9051283dd
Signed by: jahanson
SSH key fingerprint: SHA256:vy6dKBECV522aPAwklFM3ReKAVB086rT3oWwiuiFG7o
2 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,18 @@
---
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3"
tasks:
re-encrypt:
desc: Decrypt and re-encrypt all sops secrets
silent: true
dir: "{{.USER_WORKING_DIR}}"
vars:
SECRET_FILES:
sh: find . -type f -name '*.sops.yaml' ! -name ".sops.yaml"
cmds:
- for: { var: SECRET_FILES }
cmd: |
echo "Re-encrypting {{ .ITEM }}"
sops --decrypt --in-place "{{ .ITEM }}"
sops --encrypt --in-place "{{ .ITEM }}"

14
Taskfile.yaml Normal file
View file

@ -0,0 +1,14 @@
---
# go-task runner file - rest of config in .taskfiles/**.*.yaml
version: "3"
includes:
sops:
taskfile: ".taskfiles/sops"
dir: .taskfiles/sops
tasks:
default:
silent: true
cmds:
- task -l