From 7833bd3ecf75f07fe38f23d2b5600c0362939d65 Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Sun, 15 Feb 2026 17:24:56 +0000 Subject: [PATCH] Add retry logic to Drone CI clone step for transient DNS failures Disable the default clone and use a custom clone step with up to 5 retry attempts in both frontend and api pipelines. This prevents builds from failing due to transient "Could not resolve host" errors. --- .drone.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.drone.yml b/.drone.yml index e484ba4..9b85fb4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,6 +2,9 @@ kind: pipeline type: kubernetes name: frontend +clone: + disable: true + concurrency: limit: 1 @@ -14,6 +17,19 @@ trigger: - push steps: + - name: clone + image: alpine/git + commands: + - | + for i in 1 2 3 4 5; do + git clone --depth=50 "$DRONE_REMOTE_URL" . && exit 0 + echo "Clone attempt $i failed, retrying in 5s..." + sleep 5 + done + echo "Clone failed after 5 attempts" + exit 1 + - git checkout "$DRONE_COMMIT" + - name: Run frontend tests image: node:24-alpine commands: @@ -81,6 +97,9 @@ kind: pipeline type: kubernetes name: api +clone: + disable: true + concurrency: limit: 1 @@ -93,6 +112,19 @@ trigger: - push steps: + - name: clone + image: alpine/git + commands: + - | + for i in 1 2 3 4 5; do + git clone --depth=50 "$DRONE_REMOTE_URL" . && exit 0 + echo "Clone attempt $i failed, retrying in 5s..." + sleep 5 + done + echo "Clone failed after 5 attempts" + exit 1 + - git checkout "$DRONE_COMMIT" + - name: Cache test image image: plugins/docker settings: