Skip to content

Commit

Permalink
Merge pull request #621 from grafana/update-make-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jdbaldry authored Feb 13, 2024
2 parents e263f8e + 233fb20 commit 4b0dc06
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions docs/make-docs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
# [Semantic versioning](https://semver.org/) is used to help the reader identify the significance of changes.
# Changes are relevant to this script and the support docs.mk GNU Make interface.
#
# ## 5.4.0 (2024-02-12)
#
# ### Changed
#
# - Set `WEBSITE_MOUNTS=true` when a user includes the `website` project.
#
# Ensures consistent behavior across repositories.
# To disable website mounts, add `export WEBSITE_MOUNTS := false` to your `variables.mk` or `variables.mk.local` file.
# - Use website mounts and container volumes also when a user includes the `grafana-cloud` project.
#
# ## 5.3.0 (2024-02-08)
#
Expand Down Expand Up @@ -207,8 +216,6 @@ readonly DOC_VALIDATOR_SKIP_CHECKS="${DOC_VALIDATOR_SKIP_CHECKS:-^image-}"
readonly HUGO_REFLINKSERRORLEVEL="${HUGO_REFLINKSERRORLEVEL:-WARNING}"
readonly VALE_MINALERTLEVEL="${VALE_MINALERTLEVEL:-error}"
readonly WEBSITE_EXEC="${WEBSITE_EXEC:-make server-docs}"
# If set, the docs-base image will run a prebuild script that sets up Hugo mounts.
readonly WEBSITE_MOUNTS="${WEBSITE_MOUNTS:-}"

PODMAN="$(if command -v podman >/dev/null 2>&1; then echo podman; else echo docker; fi)"

Expand Down Expand Up @@ -425,7 +432,7 @@ proj_url() {
$1
POSIX_HERESTRING

if [ "${_project}" = 'website' ]; then
if [ "${_project}" = website ]; then
echo "http://localhost:${DOCS_HOST_PORT}/docs/"

unset _project _version
Expand Down Expand Up @@ -459,7 +466,7 @@ proj_dst() {
$1
POSIX_HERESTRING

if [ "${_project}" = 'website' ]; then
if [ "${_project}" = website ]; then
echo '/hugo/content'

unset _project _version
Expand Down Expand Up @@ -518,7 +525,7 @@ proj_canonical() {
$1
POSIX_HERESTRING

if [ "${_project}" = 'website' ]; then
if [ "${_project}" = website ]; then
echo '/docs'

unset _project _version
Expand Down Expand Up @@ -587,7 +594,7 @@ await_build() {
while [ "${i}" -ne "${max}" ]
do
sleep 1
debg "Retrying request to webserver assuming the process is still starting up."
debg "Retrying request to web server assuming the process is still starting up."
i=$((i + 1))

if ${req} "${url}"; then
Expand Down Expand Up @@ -640,9 +647,16 @@ for arg in "$@"; do
IFS=: read -r _project _ _repo _ <<POSIX_HERESTRING
${arg}
POSIX_HERESTRING
if [ "${_project}" = website ]; then
if [ "${_project}" = website ] || [ "${_project}" = grafana-cloud ]; then
note "Please be patient, building the website can take some time."

# If set, the docs-base image will run a prebuild script that sets up Hugo mounts.
if [ "${WEBSITE_MOUNTS}" = false ]; then
unset WEBSITE_MOUNTS
else
readonly WEBSITE_MOUNTS=true
fi

_repo="$(repo_path website)"
volumes="--volume=${_repo}/config:/hugo/config"
volumes="${volumes} --volume=${_repo}/layouts:/hugo/layouts"
Expand Down

0 comments on commit 4b0dc06

Please sign in to comment.