fix(ci): start-radicale.sh probes readiness with Python - the CI job image has no curl (#156)
CI / verify (push) Failing after 1m31s
CI / verify (push) Failing after 1m31s
Files changed: - .gitea/scripts/start-radicale.sh
This commit is contained in:
1 parent
b0c64772cc
commit
a12673452d
1 file changed
+11
-1
@@ -24,8 +24,18 @@ htpasswd_encryption = plain
|
||||
filesystem_folder = $work/data
|
||||
CONF
|
||||
"$python" -m radicale --config "$work/config" > "$work/radicale.log" 2>&1 &
|
||||
# The readiness probe uses the same Python, not curl: ci.yml's job image has no curl.
|
||||
ready='
|
||||
import base64, sys, urllib.request
|
||||
req = urllib.request.Request("http://127.0.0.1:5232/ci/", method="PROPFIND",
|
||||
headers={"Depth": "0", "Authorization": "Basic " + base64.b64encode(b"ci:ci-live-secret").decode()})
|
||||
try:
|
||||
urllib.request.urlopen(req, timeout=2)
|
||||
except Exception:
|
||||
sys.exit(1)
|
||||
'
|
||||
i=0
|
||||
until curl -fsS -o /dev/null -u ci:ci-live-secret -X PROPFIND -H 'Depth: 0' http://127.0.0.1:5232/ci/; do
|
||||
until "$python" -c "$ready"; do
|
||||
i=$((i + 1))
|
||||
if [ "$i" -gt 30 ]; then
|
||||
echo "radicale did not come up:" >&2
|
||||
|
||||
Reference in new issue
Block a user