2023-05-05 08:55:24 +00:00
|
|
|
#!/usr/bin/env bash
|
2023-07-15 18:00:51 +00:00
|
|
|
set -xe
|
2023-05-05 08:55:24 +00:00
|
|
|
|
|
|
|
TARGET_DIR=${TARGET_DIR:-"$PWD/public"}
|
2023-07-15 18:00:51 +00:00
|
|
|
FF_OFFLINE_MKDOCS_PLUGIN=${FF_OFFLINE_MKDOCS_PLUGIN:-"false"}
|
|
|
|
FF_ENABLE_COMMIT_DATA=${FF_ENABLE_COMMIT_DATA:-"true"}
|
|
|
|
FF_GENERATE_SOCIAL_CARDS=${FF_GENERATE_SOCIAL_CARDS:-"true"}
|
2023-05-05 08:55:24 +00:00
|
|
|
|
2023-07-15 18:00:51 +00:00
|
|
|
if [[ ! -d "$PWD/.venv" && $SKIP_VENV_SETUP == "" ]]; then
|
2023-09-25 14:32:29 +00:00
|
|
|
pipenv install -r requirements.txt
|
|
|
|
pipenv run -- mkdocs build -d "$TARGET_DIR"
|
2023-07-15 18:02:41 +00:00
|
|
|
else
|
|
|
|
pip3 install -r requirements.txt --upgrade
|
2023-07-16 16:21:47 +00:00
|
|
|
mkdocs build -d "$TARGET_DIR"
|
2023-05-05 08:55:24 +00:00
|
|
|
fi
|
2023-07-15 18:02:41 +00:00
|
|
|
|
2023-07-15 18:00:51 +00:00
|
|
|
mkdir "$TARGET_DIR/api"
|
|
|
|
git rev-parse HEAD > "$TARGET_DIR/api/commit"
|
2023-07-16 16:21:47 +00:00
|
|
|
cp "$TARGET_DIR/assets/images/favicon.png" "$TARGET_DIR/favicon.ico"
|
2023-05-05 08:55:24 +00:00
|
|
|
|
2023-07-15 18:00:51 +00:00
|
|
|
set +xe
|