-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
sops can take care of exporting the vars itself, no need to use shell redirection etc.
FILETEMP="$(mktemp)" && sops -d scripts/.env > $FILETEMP && sleep 3 && docker-compose --env-file $FILETEMP up -d
could be replaced with:
sops exec-file scripts/.env "docker-compose --env-file {} up -d"
Added benefits of this method:
- sops creates the temp file with restricted permissions 0600 (unlike shell redirection which uses 0644 by default)
- sops deletes the temp file when the command finishes
- much shorter/simpler!
Alternatively, one can use environment directly instead of a temp file:
sops exec-env scripts/.env "docker-compose up -d"
Metadata
Metadata
Assignees
Labels
No labels