Update filter scripts to use absolute path of .sops.yaml
This commit is contained in:
parent
64d94faf77
commit
ba20fb1242
2
.sops/decrypt-filter.sh
Normal file → Executable file
2
.sops/decrypt-filter.sh
Normal file → Executable file
@ -8,8 +8,10 @@ if [[ -f $HOME/.age/key ]]; then
|
|||||||
else
|
else
|
||||||
echo "SOPS_AGE_KEY_FILE not found at $HOME/.age/key"
|
echo "SOPS_AGE_KEY_FILE not found at $HOME/.age/key"
|
||||||
echo "Cannot decrypt secrets."
|
echo "Cannot decrypt secrets."
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
REPO_ROOT="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/.."
|
||||||
# Set input/output type
|
# Set input/output type
|
||||||
FILE_EXT="${1##*.}"
|
FILE_EXT="${1##*.}"
|
||||||
|
|
||||||
|
5
.sops/encrypt-filter.sh
Normal file → Executable file
5
.sops/encrypt-filter.sh
Normal file → Executable file
@ -11,6 +11,7 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
REPO_ROOT="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/.."
|
||||||
# Set input/output type
|
# Set input/output type
|
||||||
FILE_EXT="${1##*.}"
|
FILE_EXT="${1##*.}"
|
||||||
|
|
||||||
@ -26,7 +27,7 @@ case $FILE_EXT in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
if [[ -z ${FILE_TYPE+x} ]]; then
|
if [[ -z ${FILE_TYPE+x} ]]; then
|
||||||
sops --encrypt --config ../.sops.yaml /dev/stdin
|
sops --encrypt --config $REPO_ROOT/.sops.yaml /dev/stdin
|
||||||
else
|
else
|
||||||
sops --encrypt --config ../.sops.yaml --input-type $FILE_TYPE --output-type json /dev/stdin
|
sops --encrypt --config $REPO_ROOT/.sops.yaml --input-type $FILE_TYPE --output-type json /dev/stdin
|
||||||
fi
|
fi
|
Loading…
Reference in New Issue
Block a user