ohif-viewer/generateStaticSite.sh

58 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/bash
# Set directory to location of this script
# https://stackoverflow.com/a/3355423/1867984
cd "$(dirname "$0")"
yarn -v
2018-12-02 08:23:43 +01:00
node -v
echo 'Installing Gitbook CLI'
yarn global add gitbook-cli
echo 'Running Gitbook installation'
# Generate all version's GitBook output
# For each directory in /docs ...
cd ./docs/
for D in *; do
if [ -d "${D}" ]; then
echo "Generating output for: ${D}"
cd "${D}"
# Clear previous output, generate new
rm -rf _book
gitbook install
gitbook build
cd ..
fi
done
# Move CNAME File into `latest`
2019-04-17 20:04:31 +02:00
cp CNAME ./latest/_book/CNAME
# Create a history folder in our latest version's output
mkdir ./latest/_book/history
# Move each version's files to latest's history folder
for D in *; do
if [ -d "${D}" ]; then
2019-05-13 20:31:00 +02:00
if [ "${D}" == v* ] ; then
echo "Moving ${D} to the latest version's history folder"
mkdir "./latest/_book/history/${D}"
2019-05-13 21:07:02 +02:00
cp -v -r "./${D}/_book"/* "./latest/_book/history/${D}"
fi
fi
done
cd ..
# Build and copy the StandaloneViewer into the static directory
2019-04-29 13:03:54 +02:00
mkdir ./docs/latest/_book/demo/
2019-04-28 21:25:53 +02:00
yarn install
2019-04-29 13:03:54 +02:00
yarn build:web:ci