2023-06-06 05:51:33 +09:00
|
|
|
#!/bin/bash
|
2015-08-07 20:20:30 -07:00
|
|
|
|
|
|
|
# This script builds the website from the docs directory of
|
|
|
|
# the current branch and copies it over to the gh-pages
|
|
|
|
# branch.
|
|
|
|
|
2023-06-06 05:51:33 +09:00
|
|
|
set -eux
|
|
|
|
shopt -s dotglob
|
2015-08-07 20:20:30 -07:00
|
|
|
|
|
|
|
# build website
|
2023-06-06 05:51:33 +09:00
|
|
|
scriptdir=$(dirname "$0")
|
2015-08-07 20:20:30 -07:00
|
|
|
cd "$scriptdir"/../docs
|
|
|
|
rm -rf output
|
2023-06-06 05:51:33 +09:00
|
|
|
mkdir output
|
2019-02-20 20:50:08 -05:00
|
|
|
pipenv run python3 build_website.py
|
2015-08-07 20:20:30 -07:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
# copy to /tmp
|
|
|
|
tmpdir=$(mktemp -d -t jq.website.XXXXXXXXXX)
|
|
|
|
cp -r docs/output/* "$tmpdir"
|
2015-08-22 17:22:16 -07:00
|
|
|
cp .gitignore "$tmpdir"
|
2015-08-07 20:20:30 -07:00
|
|
|
|
|
|
|
# copy to gh-pages
|
|
|
|
git checkout gh-pages
|
|
|
|
cp -r "$tmpdir"/* .
|
2015-08-22 17:22:16 -07:00
|
|
|
cp "$tmpdir"/.gitignore .
|
2015-08-07 20:20:30 -07:00
|
|
|
|
|
|
|
# clean up
|
|
|
|
rm -rf "$tmpdir"
|
|
|
|
echo SUCCESS
|