]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
semaphore: try to use different keyservers
authorFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 20 Oct 2020 09:22:50 +0000 (11:22 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 20 Oct 2020 09:36:40 +0000 (11:36 +0200)
Recently the Semaphore CI started to fail pretty much constantly due to
GPG key verification fails. After a quick search this is a pretty common
issue with the Ubuntu keyserver in the last month. To make this,
hopefully, a bit more stable, let's use a few different keyservers in
case some of them fail.

semaphoreci/semaphore-runner.sh

index abffb205889656d60034354f8f406a712a7d03cc..cbcd38d65e554232ce0051c5e8843f4cf0f91cf4 100755 (executable)
@@ -16,11 +16,13 @@ PHASES=(${@:-SETUP RUN})
 UBUNTU_RELEASE="$(lsb_release -cs)"
 
 create_container() {
-    # create autopkgtest LXC image; this sometimes fails with "Unable to fetch
-    # GPG key from keyserver", so retry a few times
-    for retry in {1..5}; do
-        sudo lxc-create -n $CONTAINER -t download -- -d $DISTRO -r $RELEASE -a $ARCH --keyserver hkp://keyserver.ubuntu.com:80 && break
-        sleep $((retry*retry))
+    # Create autopkgtest LXC image; this sometimes fails with "Unable to fetch
+    # GPG key from keyserver", so retry a few times with different keyservers.
+    for keyserver in "" "keys.gnupg.net" "keys.openpgp.org" "keyserver.ubuntu.com"; do
+        for retry in {1..5}; do
+            sudo lxc-create -n $CONTAINER -t download -- -d $DISTRO -r $RELEASE -a $ARCH ${keyserver:+--keyserver "$keyserver"} && break 2
+            sleep $((retry*retry))
+        done
     done
 
     # unconfine the container, otherwise some tests fail