diff --git a/docs/make-docs b/docs/make-docs index 2dc6726..e811147 100755 --- a/docs/make-docs +++ b/docs/make-docs @@ -1,4 +1,6 @@ #!/bin/sh +# shellcheck disable=SC2034 +# # The source of this file is https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/make-docs. # # `make-docs` procedure changelog # @@ -6,6 +8,26 @@ # [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. # +# ## 8.4.0 (2025-01-27) +# +# ### Fixed +# +# - Correct mount for the /docs/grafana-cloud/send-data/fleet-management/ project. +# +# ## 8.3.0 (2024-12-27) +# +# ### Added +# +# - Debug output of the final command when DEBUG=true. +# +# Useful to inspect if the script is correctly constructing the final command. +# +# ## 8.2.0 (2024-12-22) +# +# ### Removed +# +# - Special cases for Oracle and Datadog plugins now that they exist in the plugins monorepo. +# # ## 8.1.0 (2024-08-22) # # ### Added @@ -13,7 +35,7 @@ # - Additional website mounts for projects that use the website repository. # # Mounts are required for `make docs` to work in the website repository or with the website project. -# The Makefile is also mounted for convenient development of the procedure that repository. +# The Makefile is also mounted for convenient development of the procedure in that repository. # # ## 8.0.1 (2024-07-01) # @@ -290,6 +312,7 @@ PODMAN="$(if command -v podman >/dev/null 2>&1; then echo podman; else echo dock if ! command -v curl >/dev/null 2>&1; then if ! command -v wget >/dev/null 2>&1; then + # shellcheck disable=SC2016 errr 'either `curl` or `wget` must be installed for this script to work.' exit 1 @@ -297,6 +320,7 @@ if ! command -v curl >/dev/null 2>&1; then fi if ! command -v "${PODMAN}" >/dev/null 2>&1; then + # shellcheck disable=SC2016 errr 'either `podman` or `docker` must be installed for this script to work.' exit 1 @@ -343,6 +367,10 @@ EOF exit 1 fi +# The following variables comprise a pseudo associative array of project names to source repositories. +# You only need to set a SOURCES variable if the project name does not match the source repository name. +# You can get a key identifier using the `identifier` function. +# To look up the value of any pseudo associative array, use the `aget` function. SOURCES_as_code='as-code-docs' SOURCES_enterprise_metrics='backend-enterprise' SOURCES_enterprise_metrics_='backend-enterprise' @@ -352,13 +380,16 @@ SOURCES_grafana_cloud_alerting_and_irm_slo='slo' SOURCES_grafana_cloud_k6='k6-docs' SOURCES_grafana_cloud_data_configuration_integrations='cloud-onboarding' SOURCES_grafana_cloud_frontend_observability_faro_web_sdk='faro-web-sdk' +SOURCES_grafana_cloud_send_data_fleet_management='fleet-management' SOURCES_helm_charts_mimir_distributed='mimir' SOURCES_helm_charts_tempo_distributed='tempo' SOURCES_opentelemetry='opentelemetry-docs' -SOURCES_plugins_grafana_datadog_datasource='datadog-datasource' -SOURCES_plugins_grafana_oracle_datasource='oracle-datasource' SOURCES_resources='website' +# The following variables comprise a pseudo associative array of project names to versions. +# You only need to set a VERSIONS variable if it is not the default of 'latest'. +# You can get a key identifier using the `identifier` function. +# To look up the value of any pseudo associative array, use the `aget` function. VERSIONS_as_code='UNVERSIONED' VERSIONS_grafana_cloud='UNVERSIONED' VERSIONS_grafana_cloud_alerting_and_irm_machine_learning='UNVERSIONED' @@ -366,20 +397,21 @@ VERSIONS_grafana_cloud_alerting_and_irm_slo='UNVERSIONED' VERSIONS_grafana_cloud_k6='UNVERSIONED' VERSIONS_grafana_cloud_data_configuration_integrations='UNVERSIONED' VERSIONS_grafana_cloud_frontend_observability_faro_web_sdk='UNVERSIONED' +VERSIONS_grafana_cloud_send_data_fleet_management='UNVERSIONED' VERSIONS_opentelemetry='UNVERSIONED' -VERSIONS_plugins_grafana_datadog_datasource='latest' -VERSIONS_plugins_grafana_oracle_datasource='latest' VERSIONS_resources='UNVERSIONED' VERSIONS_technical_documentation='UNVERSIONED' VERSIONS_website='UNVERSIONED' VERSIONS_writers_toolkit='UNVERSIONED' +# The following variables comprise a pseudo associative array of project names to source repository paths. +# You only need to set a PATHS variable if it is not the default of 'docs/sources'. +# You can get a key identifier using the `identifier` function. +# To look up the value of any pseudo associative array, use the `aget` function. PATHS_grafana_cloud='content/docs/grafana-cloud' PATHS_helm_charts_mimir_distributed='docs/sources/helm-charts/mimir-distributed' PATHS_helm_charts_tempo_distributed='docs/sources/helm-charts/tempo-distributed' PATHS_mimir='docs/sources/mimir' -PATHS_plugins_grafana_datadog_datasource='docs/sources' -PATHS_plugins_grafana_oracle_datasource='docs/sources' PATHS_resources='content' PATHS_tempo='docs/sources/tempo' PATHS_website='content' @@ -631,7 +663,7 @@ POSIX_HERESTRING case "${_project}" in # Workaround for arbitrary mounts where the version field is expected to be the local directory - # and the repo field is expected to be the container directory. + # and the repo field is expected to be the container directory. arbitrary) echo "${_project}^${_version}^${_repo}^" # TODO ;; @@ -801,10 +833,16 @@ case "${image}" in | sed "s#$(proj_dst "${proj}")#sources#" EOF + if [ -n "${DEBUG}" ]; then + debg "${cmd}" + fi + case "${OUTPUT_FORMAT}" in human) if ! command -v jq >/dev/null 2>&1; then + # shellcheck disable=SC2016 errr '`jq` must be installed for the `doc-validator` target to work.' + # shellcheck disable=SC2016 note 'To install `jq`, refer to https://jqlang.github.io/jq/download/,' exit 1 @@ -837,6 +875,10 @@ EOF /hugo/content/docs EOF + if [ -n "${DEBUG}" ]; then + debg "${cmd}" + fi + case "${OUTPUT_FORMAT}" in human) ${cmd} --output=line \