Skip to content

Commit 22c4903

Browse files
underaclaude
andauthored
Add MkDocs static site generation with nginx (#805)
* Add MkDocs static site generation with nginx Replace PWE PHP rendering with MkDocs + nginx:alpine. - mkdocs.yml with material theme and full nav structure - nginx.conf serving static files, with /repo/ proxy placeholder - Dockerfile.static: multi-stage build (python→nginx:alpine) - build.sh copies static assets (stats JSON, repo JSON, robots.txt) All 114 baseline URLs verified. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Progress * theme * Fix CI: install Python deps in workflow, drop mkdocs-material Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix build: dat/stats may not exist in CI Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * build: just mkdir dat/stats, don't copy it Stats data lives on prod only, generated by log analysis. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 94edf60 commit 22c4903

21 files changed

+1099
-8
lines changed

.github/workflows/pr.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,20 @@ jobs:
5555
steps:
5656
- uses: actions/checkout@v4
5757

58+
- name: Setup Python
59+
uses: actions/setup-python@v5
60+
with:
61+
python-version: '3.12'
62+
5863
- name: Setup PHP Action
5964
uses: shivammathur/setup-php@2.24.0
6065
with:
6166
php-version: '5.6'
6267
tools: composer
6368

69+
- name: Install Python dependencies
70+
run: pip install packaging jsonschema requests mkdocs
71+
6472
- name: Prepare upload
6573
run: ./prepare-upload.sh
6674

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ plugins/csl/bin/src/main/java/kg/apc/jmeter/reporters/ConsoleStatusLoggerGui.cla
2626
plugins/csl/bin/src/test/java/kg/apc/jmeter/reporters/ConsoleStatusLoggerGuiTest.class
2727
plugins/csl/bin/src/test/java/kg/apc/jmeter/reporters/ConsoleStatusLoggerTest.class
2828
.DS_Store
29+
/site/build/

prepare-upload.sh

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,29 @@ python downloads.py
55
rm -rf upload
66
mkdir -p upload
77

8-
# site docs
9-
cp -r site/* upload/
8+
# Build static site with MkDocs
9+
cd site
10+
bash build.sh
11+
cd ..
12+
13+
# Static site output
14+
cp -r site/build/* upload/
1015

11-
# examples
16+
# Examples
1217
cp -r examples upload/img/
1318

19+
# PHP for /repo/ endpoint (stays dynamic)
20+
cp site/index.php upload/
21+
cp site/cfg.php upload/
22+
cp site/composer.json upload/
23+
cp -r site/JPGC upload/
24+
1425
php --version
1526
curl -sS https://getcomposer.org/installer | php
1627
cd upload
1728
../composer.phar update --no-dev --prefer-stable
18-
cp vendor/undera/pwe/.htaccess ./
1929
cd ..
2030

2131
cd upload
22-
zip -r site.zip * .htaccess
32+
zip -r site.zip *
2333
cd ..

site/Dockerfile.static

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
FROM python:3.12-slim AS builder
2+
3+
WORKDIR /src
4+
COPY . .
5+
RUN pip install --no-cache-dir mkdocs \
6+
&& bash build.sh
7+
8+
FROM nginx:alpine
9+
10+
COPY --from=builder /src/build /usr/share/nginx/html
11+
12+
RUN cat > /etc/nginx/conf.d/default.conf << 'NGINX'
13+
server {
14+
listen 80;
15+
server_name localhost;
16+
root /usr/share/nginx/html;
17+
index index.html;
18+
absolute_redirect off;
19+
20+
location ~ ^/(wiki|install|stats|catalogue)/[^/]+$ {
21+
return 301 $uri/;
22+
}
23+
24+
location = /wiki/ { return 302 /wiki/Start/; }
25+
location = /install/ { return 302 /install/Install/; }
26+
location = /catalogue/ { return 302 /; }
27+
location = /get/ { return 302 https://search.maven.org/remotecontent?filepath=kg/apc/jmeter-plugins-manager/1.12/jmeter-plugins-manager-1.12.jar; }
28+
location = /support/ { return 302 https://groups.google.com/forum/#!forum/jmeter-plugins; }
29+
location /editor/ { return 302 /editor/?utm_source=jpgc&utm_medium=banner&utm_campaign=menu; }
30+
location = /sources/ { return 302 https://github.com/undera/jmeter-plugins; }
31+
location = /downloads/ { return 302 /install/Install/; }
32+
33+
location = /wiki/DirectoryListing/ { return 302 https://github.com/Blazemeter/jmeter-bzm-plugins/blob/master/directory-listing/DirectoryListing.md; }
34+
location = /wiki/LoadosophiaUploader/ { return 302 https://github.com/Blazemeter/jmeter-bzm-plugins/blob/master/sense-uploader/LoadosophiaUploader.md; }
35+
location = /wiki/PerfMonAgent/ { return 302 https://github.com/undera/perfmon-agent; }
36+
37+
location / {
38+
try_files $uri $uri/index.html $uri/ =404;
39+
}
40+
41+
location ~* \.(css|js|png|jpg|gif|svg|ico|json|csv)$ {
42+
expires 1h;
43+
add_header Cache-Control "public, no-transform";
44+
}
45+
46+
error_page 404 /404.html;
47+
}
48+
NGINX
49+
50+
EXPOSE 80
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build/
2+
logs/
3+
vendor/

site/build.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
set -e
3+
4+
cd "$(dirname "$0")"
5+
6+
mkdocs build --clean
7+
8+
# Static assets not managed by MkDocs
9+
cp robots.txt build/
10+
cp favicon.ico build/ 2>/dev/null || true
11+
cp -r img build/
12+
mkdir -p build/dat/stats
13+
cp -r dat/repo build/dat/
14+
15+
echo "Build complete: build/"

site/dat/catalogue.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: Browse Plugins
3+
template: catalogue.html
4+
---

site/dat/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: JMeter Plugins
3+
template: catalogue.html
4+
---

site/dat/install/Install.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Installing Plugins
2+
3+
The easiest way to get the plugins is to install [Plugins Manager](/wiki/PluginsManager/). Then you'll be able to install any other plugins just by clicking a checkbox.
4+
5+
<div markdown="1" class="alert alert-success">
6+
Download **[plugins-manager.jar](/get/)** and put it into `lib/ext` directory, then restart JMeter.
7+
</div>
8+
9+
If you experience any issues with plugins installation, don't hesitate to ask at [Support Forums](/support/).

site/dat/stats.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: Usage Statistics
3+
template: stats.html
4+
---

0 commit comments

Comments
 (0)