ohif-viewer/generateStaticSite.sh

61 lines
1.3 KiB
Bash
Raw Normal View History

cd docs
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 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
if [[ "${D}" == v* ]] ; then
echo "Moving ${D} to the latest version's history folder"
mkdir "./latest/_book/history/${D}"
mv -v "./${D}/_book"/* "./latest/_book/history/${D}"
fi
fi
done
cd ..
# Build and copy the StandaloneViewer into the static directory
2019-04-17 21:43:04 +02:00
echo $DEPLOY_PRIME_URL
export ROOT_URL=$DEPLOY_PRIME_URL/demo
2019-04-17 20:34:49 +02:00
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
2019-04-19 20:43:25 +02:00
2019-04-28 21:25:53 +02:00
# OLD DEPLOY
2019-04-19 20:43:25 +02:00
# cd example
# yarn install
# yarn run prepare
# sed -i "s,http://localhost:5000,${ROOT_URL},g" index.html
# sed -i 's,"routerBasename": "/","routerBasename": "/demo",g' index.html
# rm -rf node_modules
2019-04-28 21:25:53 +02:00
# NEW DEPLOY
2019-04-29 13:03:54 +02:00
# cpx 'build/*' docs/latest/_book/demo --verbose