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-10-07 03:23:56 +00:00
|
|
|
TARGET_BUILD_CONFIG=${1:-"mkdocs.yml"}
|
|
|
|
|
|
|
|
if [[ ! -d "$TARGET_DIR" ]]; then
|
|
|
|
mkdir "$TARGET_DIR" -pv
|
|
|
|
fi
|
2023-05-05 08:55:24 +00:00
|
|
|
|
2023-10-06 17:03:54 +00:00
|
|
|
if [[ $SKIP_VENV_SETUP == "" ]] || [[ $CI == "" ]]; then
|
2023-10-07 03:38:26 +00:00
|
|
|
pipenv install --ignore-pipfile --deploy --verbose
|
2023-10-07 03:23:56 +00:00
|
|
|
pipenv run -- mkdocs build -d "$TARGET_DIR" -f ${TARGET_BUILD_CONFIG}
|
2023-07-15 18:02:41 +00:00
|
|
|
else
|
2023-10-06 17:03:54 +00:00
|
|
|
pip3 install -r requirements.txt --upgrade --user
|
2023-10-07 03:23:56 +00:00
|
|
|
mkdocs build -d "$TARGET_DIR" -f ${TARGET_BUILD_CONFIG}
|
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-10-06 17:03:54 +00:00
|
|
|
cp markdown/.well-known "$TARGET_DIR/.well-known" -rv
|
2023-05-05 08:55:24 +00:00
|
|
|
|
2023-07-15 18:00:51 +00:00
|
|
|
set +xe
|