]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Fix: CI: test: recipient creation procedure (#10)
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 4 Jan 2025 21:07:23 +0000 (18:07 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 4 Jan 2025 21:07:23 +0000 (18:07 -0300)
.gitlab-ci.yml

index 6a27e8b9eae09f5e794e5fff4db7fd9122241e45..11e580b33869048f4a1e34b2250077e6cfd17b81 100644 (file)
@@ -78,7 +78,13 @@ test:
     - git config --global user.name 'Test'
     - git config --global user.email 'test@example.org'
     - ./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
+
+    # Build the recipients configuration
+    # Explanation on the "paste" syntax is available at https://stackoverflow.com/a/9605450
+    - gpg --with-colons --list-keys | grep "^uid" | head -1 | awk -F ':' '{ x = $10; gsub(/.*</, "", x); gsub(/>/, "", x); print x; }' > ~/temp/tests/recipients
+    - gpg --with-colons --list-public-keys --with-fingerprint | grep "^fpr" | head -1 | awk -F ':' '{ print $10 }' >> ~/temp/tests/recipients
+    - paste -d " " - - < ~/temp/tests/recipients > ~/temp/tests/keyringer/config/recipients/default
+    - rm ~/temp/tests/recipients
     - ./keyringer test recipients ls
 
     # Test the keyring in the develop branch