Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion .github/workflows/build-pelican.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ on:
paths-ignore:
- 'README.md'
- 'LICENSE'
- 'build.sh'
- '.editorconfig'
- '.gitignore'
- '.gitattributes'
# MCP docs are sourced from apache/solr-mcp (see "Fetch MCP docs" below). Changes
# there do not push here, so refresh asf-staging from solr-mcp main on a schedule.
# solr-mcp CI may also trigger this immediately via repository_dispatch / the API.
schedule:
- cron: '17 6 * * *'
workflow_dispatch:
repository_dispatch:
types: [ mcp-docs-updated ]

jobs:
build-pelican:
Expand All @@ -37,6 +43,20 @@ jobs:
with:
ref: ${{ github.ref == 'refs/heads/production' && 'production' || 'main' }}

# MCP docs content lives in apache/solr-mcp so it travels with the code.
# Assemble it into content/ before Pelican renders the site. MCP_DOCS_REF is a
# fixed branch name (never untrusted event input) to avoid ref/command injection.
- name: Fetch MCP docs from apache/solr-mcp
env:
MCP_DOCS_REF: main
run: |
git clone --quiet --depth 1 --branch "$MCP_DOCS_REF" \
https://github.com/apache/solr-mcp.git /tmp/solr-mcp
rm -rf content/pages/mcp
mkdir -p content/pages content/doap
cp -R /tmp/solr-mcp/docs/site/content/pages/mcp content/pages/mcp
cp -R /tmp/solr-mcp/docs/site/content/doap/. content/doap/

- name: Build Pelican Site
uses: apache/infrastructure-actions/pelican@4deec7dce934d27491a0b1a8216f8d292548f7a4 # main 2025-04-13
with:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/pr-build-pelican.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
# MCP docs content lives in apache/solr-mcp so it travels with the code.
# Assemble it into content/ so the PR build validates the full site.
- name: Fetch MCP docs from apache/solr-mcp
env:
MCP_DOCS_REF: main
run: |
git clone --quiet --depth 1 --branch "$MCP_DOCS_REF" \
https://github.com/apache/solr-mcp.git /tmp/solr-mcp
rm -rf content/pages/mcp
mkdir -p content/pages content/doap
cp -R /tmp/solr-mcp/docs/site/content/pages/mcp content/pages/mcp
cp -R /tmp/solr-mcp/docs/site/content/doap/. content/doap/
- name: Build Pelican Site
uses: apache/infrastructure-actions/pelican@4deec7dce934d27491a0b1a8216f8d292548f7a4 # main 2025-04-13
with:
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ CLAUDE.md
.cursor/
GEMINI.md
.gemini/

# MCP docs are sourced from apache/solr-mcp at build time (see build.sh fetch_mcp_docs
# and the "Fetch MCP docs" step in .github/workflows/*pelican*.yml). Do not commit them.
/content/pages/mcp/
/content/doap/solr-mcp.rdf
29 changes: 29 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ OPTIONS=(
":pelican-help:Show all options accepted by Pelican"
)

# MCP documentation content is sourced from the apache/solr-mcp repo so that docs
# travel with the code (see https://github.com/apache/solr-mcp/tree/main/docs/site).
# It is assembled into content/ before Pelican runs. A sibling local checkout is used
# when present (for live preview); otherwise the pinned ref is cloned.
MCP_DOCS_REPO="${MCP_DOCS_REPO:-https://github.com/apache/solr-mcp.git}"
MCP_DOCS_REF="${MCP_DOCS_REF:-main}"
MCP_DOCS_LOCAL="${MCP_DOCS_LOCAL:-../solr-mcp/docs/site/content}"

function usage {
echo "Usage: ./build.sh [OPTIONS] [-- <pelican arguments>]"
echo ""
Expand Down Expand Up @@ -70,6 +78,26 @@ function _getopt_specs {
echo "${short}|${long}"
}

function fetch_mcp_docs {
local src tmp
if [[ -d "$MCP_DOCS_LOCAL" ]]; then
echo "Assembling MCP docs from local checkout: $MCP_DOCS_LOCAL"
src="$MCP_DOCS_LOCAL"
else
echo "Fetching MCP docs from $MCP_DOCS_REPO @ $MCP_DOCS_REF"
tmp="$(mktemp -d)"
git clone --quiet --depth 1 --branch "$MCP_DOCS_REF" "$MCP_DOCS_REPO" "$tmp"
src="$tmp/docs/site/content"
fi
# Pages: replace wholesale so removed pages don't linger.
rm -rf content/pages/mcp
mkdir -p content/pages content/doap
cp -R "$src/pages/mcp" content/pages/mcp
# DOAP: copy the MCP descriptor alongside the others (do not touch them).
cp -R "$src/doap/." content/doap/
[[ -n "$tmp" ]] && rm -rf "$tmp"
}

function build_image {
echo "Building local Docker image for Pelican, called $SOLR_LOCAL_PELICAN_IMAGE."
docker build --no-cache -t $SOLR_LOCAL_PELICAN_IMAGE .
Expand Down Expand Up @@ -174,6 +202,7 @@ else
check_requirements_update
fi

fetch_mcp_docs
if [[ $SERVE ]]; then
echo "Building Solr site locally. Goto http://localhost:8000 to view."
echo "Edits you do to the source tree will be compiled immediately!"
Expand Down
4 changes: 4 additions & 0 deletions pelicanconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
SOLR_OPERATOR_LATEST_RELEASE_DATE = datetime(2025, 3, 25)
SOLR_OPERATOR_PREVIOUS_MAJOR_RELEASE = 'v0.8.1'

SOLR_MCP_LATEST_RELEASE = 'v1.0.0'
#SOLR_MCP_LATEST_RELEASE_DATE = datetime(2025, 3, 25)
#SOLR_MCP_PREVIOUS_MAJOR_RELEASE = 'v0.8.1'

# This string will be appended to all unversioned css and js resources to prevent caching surprises on edits.
# The theme's htaccess file also sets a cache-control header with longer lifetime, if the v=XXXX query string is added.
STATIC_RESOURCE_SUFFIX = "?v=%s" % dirhash('themes/solr/static', 'sha1')[-8:]
Expand Down
Loading