Skip to content

Commit 781c005

Browse files
authored
Merge pull request #259 from grafana/2023-09-04/update-make-docs
Update `make docs` procedure
2 parents 0f886c6 + dffa84d commit 781c005

File tree

1 file changed

+35
-19
lines changed

1 file changed

+35
-19
lines changed

Diff for: docs/make-docs

+35-19
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
# [Semantic versioning](https://semver.org/) is used to help the reader identify the significance of changes.
77
# Changes are relevant to this script and the support docs.mk GNU Make interface.
88

9+
# ## 4.2.0 (2023-09-01)
10+
11+
# ### Added
12+
13+
# - Retry the initial webserver request up to ten times to allow for the process to start.
14+
# If it is still failing after ten seconds, an error message is logged.
15+
916
# ## 4.1.1 (2023-07-20)
1017

1118
# ### Fixed
@@ -439,30 +446,39 @@ await_build() {
439446
url="$1"
440447
req="$(if command -v curl >/dev/null 2>&1; then echo 'curl -s -o /dev/null'; else echo 'wget -q'; fi)"
441448

442-
sleep 2
443-
444-
if ${req} "${url}"; then
445-
echo
446-
echo "View documentation locally:"
447-
for x in ${url_src_dst_vers}; do
448-
IFS='^' read -r url _ _ <<POSIX_HERESTRING
449+
i=1
450+
max=10
451+
while [ "${i}" -ne "${max}" ]
452+
do
453+
sleep 1
454+
debg "Retrying request to webserver assuming the process is still starting up."
455+
i=$((i + 1))
456+
457+
if ${req} "${url}"; then
458+
echo
459+
echo "View documentation locally:"
460+
for x in ${url_src_dst_vers}; do
461+
IFS='^' read -r url _ _ <<POSIX_HERESTRING
449462
$x
450463
POSIX_HERESTRING
451464

452-
if [ -n "${url}" ]; then
453-
if [ "${_url}" != "arbitrary" ]; then
454-
echo " ${url}"
465+
if [ -n "${url}" ]; then
466+
if [ "${_url}" != "arbitrary" ]; then
467+
echo " ${url}"
468+
fi
455469
fi
456-
fi
457-
done
458-
echo
459-
echo 'Press Ctrl+C to stop the server'
460-
else
461-
echo
462-
errr 'The build was interrupted or a build error occurred, check the previous logs for possible causes.'
463-
fi
470+
done
471+
echo
472+
echo 'Press Ctrl+C to stop the server'
473+
474+
unset i max req url
475+
return
476+
fi
477+
done
464478

465-
unset url req
479+
echo
480+
errr 'The build was interrupted or a build error occurred, check the previous logs for possible causes.'
481+
unset i max req url
466482
}
467483

468484
debg() {

0 commit comments

Comments
 (0)