Skip to content

Commit

Permalink
Fixing pathing in model docs generation CI/CD script.
Browse files Browse the repository at this point in the history
  • Loading branch information
david-waltermire committed Jun 7, 2021
1 parent 8c1b8b0 commit 6abb7e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build/ci-cd/generate-model-documentation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ if [ "$#" -ne 0 ]; then
fi

# generate reference documentation
DOCS_DIR="${OSCAL_DIR}/docs";
if [[ "$BRANCH" =~ ^v.* ]]; then
VERSION="${BRANCH/#"v"}"
REVISION="${VERSION}"
Expand Down Expand Up @@ -162,7 +163,7 @@ doc_path="${WORKING_DIR}${doc_path_base}${REVISION}"
if [ ! -d "${doc_path}" ] || [ "$DISABLE_ARCHETYPE_CREATION" = "false" ]; then
[ -d "${doc_path}" ] && rm -rf "${doc_path}"

result=$(HUGO_REF_TYPE="${TYPE}" HUGO_REF_BRANCH="${BRANCH}" HUGO_REF_VERSION="${VERSION}" HUGO_REF_REVISION="${REVISION}" hugo new --kind reference "${doc_path}" 2>&1)
result=$(cd ${DOCS_DIR};HUGO_REF_TYPE="${TYPE}" HUGO_REF_BRANCH="${BRANCH}" HUGO_REF_VERSION="${VERSION}" HUGO_REF_REVISION="${REVISION}" hugo new --config "${OSCAL_DIR}/docs/config.yaml" --kind reference "${doc_path}" 2>&1)
cmd_exitcode=$?
if [ $cmd_exitcode -ne 0 ]; then
echo -e "${P_ERROR}Generating index page failed for revision '${P_END}${REVISION}${P_ERROR}' on branch '${P_END}${BRANCH}${P_ERROR}'.${P_END}"
Expand Down Expand Up @@ -210,7 +211,7 @@ while IFS="|" read metaschema_path archetype model_id model_name schema_id || [[
# build the version folder
#if [ -d "${model_path}" ] && rm -rf "${doc_path}"

result=$(HUGO_REF_TYPE="${TYPE}" HUGO_REF_BRANCH="${BRANCH}" HUGO_REF_VERSION="${VERSION}" HUGO_REF_REVISION="${REVISION}" HUGO_MODEL_NAME="${model_name}" HUGO_MODEL_ID="${model_id}" HUGO_SCHEMA_ID="${schema_id}" hugo new --kind ${archetype} "${model_path}" 2>&1)
result=$(cd ${DOCS_DIR};HUGO_REF_TYPE="${TYPE}" HUGO_REF_BRANCH="${BRANCH}" HUGO_REF_VERSION="${VERSION}" HUGO_REF_REVISION="${REVISION}" HUGO_MODEL_NAME="${model_name}" HUGO_MODEL_ID="${model_id}" HUGO_SCHEMA_ID="${schema_id}" hugo new --kind ${archetype} "${model_path}" 2>&1)
cmd_exitcode=$?
if [ $cmd_exitcode -ne 0 ]; then
echo -e "${P_ERROR}Generating '${P_END}${model_id}${P_OK}' model page failed for revision '${P_END}${REVISION}${P_ERROR}' on branch '${P_END}${BRANCH}${P_ERROR}'.${P_END}"
Expand Down

0 comments on commit 6abb7e7

Please sign in to comment.