2020-03-09 16:40:48 -05:00
|
|
|
#!/bin/bash
|
|
|
|
# update nuxt
|
2020-03-25 09:31:52 -05:00
|
|
|
set -x
|
|
|
|
set -e
|
2020-03-09 17:46:10 -05:00
|
|
|
|
2020-03-09 18:19:47 -05:00
|
|
|
GUIDEBOOK="target/guidebook"
|
2020-03-09 17:46:10 -05:00
|
|
|
|
2020-03-09 18:19:47 -05:00
|
|
|
if [ ! -f "target/nb.jar" ]
|
2020-03-09 16:40:48 -05:00
|
|
|
then
|
2020-03-09 18:19:47 -05:00
|
|
|
printf "You should not run this unless you have target/nb.jar\n"
|
2020-03-09 17:46:10 -05:00
|
|
|
exit 6
|
2020-03-09 16:40:48 -05:00
|
|
|
fi
|
|
|
|
|
2020-03-09 18:19:47 -05:00
|
|
|
if [ ! -d "target/guidebook" ]
|
2020-03-09 17:46:10 -05:00
|
|
|
then
|
|
|
|
|
2020-03-23 16:18:04 -05:00
|
|
|
# pushd ../docsys/src/main/node/docsys || exit 1
|
|
|
|
# if ! ./update.sh "$@"
|
|
|
|
# then
|
|
|
|
# printf "Unable to update the guidebook static app\n"
|
|
|
|
# exit 2;
|
|
|
|
# fi
|
|
|
|
# popd
|
2020-03-20 09:54:15 -05:00
|
|
|
cp -R ../docsys/src/main/resources/docsys-guidebook/ ${GUIDEBOOK}/
|
2020-03-09 17:46:10 -05:00
|
|
|
else
|
2020-03-20 09:54:15 -05:00
|
|
|
printf "${GUIDEBOOK} exists, not building again until mvn clean\n"
|
2020-03-09 17:46:10 -05:00
|
|
|
fi
|
|
|
|
|
2020-04-16 05:47:13 -05:00
|
|
|
JAVA=java
|
|
|
|
if [ -n "$JAVA_HOME" ]
|
|
|
|
then JAVA=${JAVA_HOME}/bin/java
|
|
|
|
fi
|
2020-03-09 17:46:10 -05:00
|
|
|
|
|
|
|
if [ ! -x "$JAVA" ]
|
|
|
|
then
|
|
|
|
printf "Java was not found in the path and JAVA_HOME is not set\n"
|
|
|
|
exit 5
|
|
|
|
fi
|
2020-03-09 16:40:48 -05:00
|
|
|
|
2020-03-20 09:54:15 -05:00
|
|
|
$JAVA -jar target/nb.jar docserver generate ${GUIDEBOOK}/
|
2020-03-09 16:40:48 -05:00
|
|
|
|
2020-09-03 12:11:52 -05:00
|
|
|
$JAVA -jar target/nb.jar virtdata gendocs basedir ${GUIDEBOOK}/services/docs/bindings
|
|
|
|
|
|
|
|
driversdir="${GUIDEBOOK}/services/docs/drivers"
|
2020-03-30 00:10:31 -05:00
|
|
|
mkdir -p $driversdir
|
|
|
|
|
|
|
|
drivers=$($JAVA -jar target/nb.jar --list-drivers)
|
|
|
|
for driver in $drivers
|
|
|
|
do
|
|
|
|
echo "driver: $driver"
|
|
|
|
targetmd="${driversdir}/${driver}.md"
|
|
|
|
echo "targetmd: $targetmd"
|
|
|
|
printf -- "---\ntitle: driver - $driver\nweight: 50\n---\n" > $targetmd
|
2020-03-30 00:54:58 -05:00
|
|
|
printf -- "drivers/${driver}.md\n" >> ${GUIDEBOOK}/services/docs/markdown.csv
|
2020-03-30 00:10:31 -05:00
|
|
|
$JAVA -jar target/nb.jar help $driver >> $targetmd
|
|
|
|
done
|
2020-04-01 10:35:51 -05:00
|
|
|
(
|
|
|
|
cd ${GUIDEBOOK}/services/docs;
|
2020-09-03 12:11:52 -05:00
|
|
|
find * -type f -name '*.md' | sort > markdown.csv
|
2020-04-01 10:35:51 -05:00
|
|
|
)
|
2020-03-30 00:10:31 -05:00
|
|
|
|
2020-03-09 17:46:10 -05:00
|
|
|
#JAVA_HOME=${JAVA_HOME:-JAVA_HOME must be specified if java isn not in the path}
|
|
|
|
#
|
|
|
|
## static site for gh pages
|
2020-03-20 09:54:15 -05:00
|
|
|
#java -jar nb/target/nb.jar docserver generate ${GUIDEBOOK}/
|