Files
my-rook-config/build/deploy/generate-deploy-examples.sh
T
Michael AdamandBlaine Gardner 22882c5358 multus: auto-update the validation job manifest file with help text
Signed-off-by: Michael Adam <obnox@samba.org>

this change  introduces a new 'make target 'docs'that generates part of the documentation

It particular, it runs the `helm-docs` target.

Additionally, `make docs`  updates the  multus validation job manifest
by inserting the output of `rook multus validation run --help` between
two newly introduced markers.

The result of running `make docs` is intended to be committed to git after running

Fixes: #12706

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Blaine Gardner <b.blaine.gardner@gmail.com>
Co-authored-by: Blaine Gardner <b.blaine.gardner@gmail.com>
Co-authored-by: Michael Adam <obnox@samba.org>

Update build/deploy/generate-deploy-examples.sh

Signed-off-by: Michael Adam <obnox@samba.org>
2023-08-25 18:37:16 +02:00

25 lines
767 B
Bash
Executable File

#! /usr/bin/env bash
set -e
SCRIPT_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)
MANIFEST_FILE=../../deploy/examples/multus-validation.yaml
SED=${SCRIPT_ROOT}/../../build/sed-in-place
if [[ ${SKIP_GEN} = true ]]; then
echo "SKIP_GEN is set, skipping manifest generation"
exit
fi
OUT_FILE="${SCRIPT_ROOT}/${MANIFEST_FILE}"
TMP_FILE="$(mktemp)"
START_MARKER='# THE BELOW HELP TEXT IS AUTO-GENERATED BY `make docs`$'
END_MARKER='# THE ABOVE HELP TEXT IS AUTO-GENERATED BY `make docs`$'
go run ${SCRIPT_ROOT}/../../cmd/rook/*.go multus validation run --help | awk '{print "# "$0}' | sed -e 's/[ \t]*$//' > ${TMP_FILE}
${SED} -e "/$START_MARKER/,/$END_MARKER/{ /$START_MARKER/{ p ; r $TMP_FILE
}; /$END_MARKER/p; d; }" ${OUT_FILE}
rm -f ${TMP_FILE}