forked from OHIF/Viewers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2,377 changed files
with
62,423 additions
and
98,051 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/bin/bash | ||
|
||
# Set directory to location of this script | ||
# https://stackoverflow.com/a/3355423/1867984 | ||
cd "$(dirname "$0")" | ||
|
||
yarn -v | ||
node -v | ||
|
||
echo 'Installing Gitbook CLI' | ||
|
||
yarn global bin | ||
yarn config get prefix | ||
yarn config set prefix ~/.yarn | ||
export PATH="$PATH:`yarn global bin`" | ||
|
||
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` | ||
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}" | ||
cp -v -r "./${D}/_book"/* "./latest/_book/history/${D}" | ||
|
||
fi | ||
fi | ||
done | ||
|
||
# Back to repo root | ||
cd .. | ||
|
||
echo "Done generating documentation output" | ||
echo 'STARTING PUBLISH' | ||
|
||
# WILL ALWAYS FAIL IF INITIATED FROM PR BRANCH | ||
./node_modules/.bin/gh-pages \ | ||
--silent \ | ||
--repo https://$GITHUB_TOKEN@github.com/OHIF/Viewers.git \ | ||
--message 'Autogenerated Message: [ci skip]' \ | ||
--dist docs/latest/_book |
Oops, something went wrong.