aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/deploy-docs.sh
diff options
context:
space:
mode:
authorEugene Triguba <hello@eugenetriguba.com>2025-10-11 11:47:38 -0400
committerEugene Triguba <hello@eugenetriguba.com>2025-10-11 11:47:38 -0400
commit8721b1b32fa65b3a072d79a7415056eb2ced7be1 (patch)
treeac9c6240357832711445b6050d0ab7b3023c6305 /scripts/deploy-docs.sh
parentRemove extra quotes in index.md (diff)
downloadcli-8721b1b32fa65b3a072d79a7415056eb2ced7be1.zip
Add support for deploy-docs to work easily locally
Diffstat (limited to 'scripts/deploy-docs.sh')
-rwxr-xr-xscripts/deploy-docs.sh33
1 files changed, 28 insertions, 5 deletions
diff --git a/scripts/deploy-docs.sh b/scripts/deploy-docs.sh
index b9e8b41..c59d0a0 100755
--- a/scripts/deploy-docs.sh
+++ b/scripts/deploy-docs.sh
@@ -2,9 +2,12 @@
set -eou pipefail
source "$(dirname "${BASH_SOURCE[0]}")/lib/log.sh"
+source "$(dirname "${BASH_SOURCE[0]}")/lib/path.sh"
readonly SITE="bolt.eugenetriguba.com"
-readonly BUILD_DIR="site"
+readonly BUILD_DIR="${PATH_PROJECT_DIR}/site"
+readonly VENV_DIR="${PATH_PROJECT_DIR}/.venv-docs"
+readonly DOCS_REQUIREMENTS_FILE="${PATH_PROJECT_DIR}/docs/requirements-docs.txt"
usage() {
echo "Usage: $0"
@@ -30,6 +33,7 @@ main() {
local version="${VERSION:-latest}"
log_info "Deploying version: $version"
+ check_and_setup_docs_env
fetch_existing_site
build_version "$version"
update_versions_manifest
@@ -37,6 +41,29 @@ main() {
deploy_to_pages "$version"
}
+check_and_setup_docs_env() {
+ log_step "Checking documentation dependencies"
+
+ if command -v mkdocs >/dev/null && python3 -m pip list | grep -q "mkdocs-material"; then
+ log_success "MkDocs dependencies found in system"
+ return 0
+ fi
+
+ log_info "MkDocs dependencies not found, setting up virtual environment"
+ if [[ ! -d "$VENV_DIR" ]]; then
+ log_step "Creating virtual environment"
+ python3 -m venv "$VENV_DIR"
+ log_success "Virtual environment created"
+ fi
+
+ log_step "Activating virtual environment"
+ # shellcheck disable=SC1091
+ source "$VENV_DIR/bin/activate"
+ log_step "Installing documentation dependencies"
+ pip install --requirement "${DOCS_REQUIREMENTS_FILE}"
+ log_success "Dependencies installed"
+}
+
fetch_existing_site() {
log_step "Fetching existing site"
mkdir -p "$BUILD_DIR"
@@ -69,10 +96,7 @@ build_version() {
update_versions_manifest() {
log_step "Updating versions manifest"
- # Build array of versions using jq
local versions_json="[]"
-
- # Add 'latest' if it exists
if [[ -d "$BUILD_DIR/latest" ]]; then
versions_json=$(echo "$versions_json" | jq '. += [{"version": "latest", "title": "Latest (Development)"}]')
fi
@@ -86,7 +110,6 @@ update_versions_manifest() {
done
fi
- # Create final JSON structure
jq -n --argjson versions "$versions_json" '{"versions": $versions}' >"$BUILD_DIR/versions.json"
local version_count