Files
hawkbit/docs/build-htmls.sh
Denislav Prinov 3978454900 HTTP documentation generation from OpenApi documentation (#1438)
* Generating rest doc from swagger json

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>

* refactoring and adding doc

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>

* refactoring

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>

* Don't directly inject files in the executable jar since it brakes it

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>

* using the attachArtifact configuration to generate secondary artifact

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>

* Splitting the json documentation into mgmt and ddi. And some refactoring

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>

* refactoring

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>

* Split mgmt and DDI components from the json

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>

---------

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>
2023-09-27 11:44:30 +03:00

44 lines
1.2 KiB
Bash

#
# Copyright (c) 2018 Bosch Software Innovations GmbH and others
#
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
#!/bin/bash
CURRENT_DIR=$(pwd)
# Checking for Redoc CLI and npm
redoc-cli --version > /dev/null 2>&1
if [ $? != 0 ]; then
echo "[ERROR] Redoc CLI is not installed! Please make suer to install it before trying again."
exit 1
else
echo "[INFO] Redoc CLI is already installed."
fi
# Execute the npx command
npx @redocly/cli build-docs ${CURRENT_DIR}/content/rest-api/mgmt.json -o ${CURRENT_DIR}/content/rest-api/mgmt.html
if [ $? != 0 ]; then
echo "[ERROR] Failed to execute the Redoc CLI command form MGMT API."
exit 1
else
echo "[INFO] Successfully executed the Redoc CLI command for MGMT API."
fi
# Execute the npx command
npx @redocly/cli build-docs ${CURRENT_DIR}/content/rest-api/ddi.json -o ${CURRENT_DIR}/content/rest-api/ddi.html
if [ $? != 0 ]; then
echo "[ERROR] Failed to execute the Redoc CLI command form DDI API."
exit 1
else
echo "[INFO] Successfully executed the Redoc CLI command for DDI API."
fi