diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2025-01-04 17:24:15 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2025-01-04 17:24:15 -0300 |
commit | 162944bc4919579dfae34a59b9c04a86f3509316 (patch) | |
tree | ee3d9fd83b797295ba4dd99225a1b9f5d98e3f24 | |
parent | d70574440fbe7a3e70f5c3fd640e994ede69126c (diff) | |
download | keyringer-162944bc4919579dfae34a59b9c04a86f3509316.tar.gz keyringer-162944bc4919579dfae34a59b9c04a86f3509316.tar.bz2 |
Feat: init: allow for non-interactive mode, useful for automated tests (#10)
-rw-r--r-- | .gitlab-ci.yml | 2 | ||||
-rwxr-xr-x | keyringer | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4967378..2881afb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -73,7 +73,7 @@ test: - mkdir -p ~/temp/tests - git config --global user.name 'Test' - git config --global user.email 'test@example.org' - - ./keyringer test init ~/temp/tests/keyringer + - KEYRINGER_NON_INTERACTIVE=1 ./keyringer test init ~/temp/tests/keyringer - gpg --with-colons --list-keys | grep uid | awk -F ':' '{ x = $10; gsub(/.*</, "", x); gsub(/>/, "", x); print x, $8; }' >> ~/temp/tests/keyringer/config/recipients/default - ./keyringer test check - ./keyringer test teardown -y @@ -112,10 +112,12 @@ function keyringer_init { fi # Edit default recipients - echo "Now you have to edit the default recipient configuration to be able to encrypt secrets." - echo "Press any key to proceed editing..." - read key - keyringer_exec recipients "$BASEDIR" edit default + if [ "$KEYRINGER_NON_INTERACTIVE" != "1" ]; then + echo "Now you have to edit the default recipient configuration to be able to encrypt secrets." + echo "Press any key to proceed editing..." + read key + keyringer_exec recipients "$BASEDIR" edit default + fi # Stage and commit keyringer_exec git "$BASEDIR" add . |