Compare commits
21 Commits
add-feedba
...
e356431b72
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e356431b72 | ||
|
|
89404a2042 | ||
| c6dc7fe310 | |||
| 411abf8683 | |||
| c3fef46d6a | |||
| a0994a5c16 | |||
| 7bda4a1155 | |||
| 3f2ecebb08 | |||
| c9b59737b9 | |||
| 067965d983 | |||
| b9f6697100 | |||
| 106e680f11 | |||
| b1e987f1b1 | |||
|
|
13308d4b4b | ||
| 9e2943754f | |||
|
|
b20a70b860 | ||
| b371431aa5 | |||
|
|
c86868b11c | ||
| 2315422d4f | |||
|
|
29f299f984 | ||
|
|
8428dc9b1a |
41
.github/workflows/build.yml
vendored
41
.github/workflows/build.yml
vendored
@@ -25,39 +25,26 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
|
||||||
image: rockylinux:9
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install system dependencies
|
- name: Build Docker image
|
||||||
run: |
|
run: |
|
||||||
dnf install -y \
|
docker build -t rocky-man:latest .
|
||||||
python3.11 \
|
|
||||||
python3.11-pip \
|
|
||||||
mandoc \
|
|
||||||
rpm-build \
|
|
||||||
dnf-plugins-core \
|
|
||||||
git
|
|
||||||
|
|
||||||
- name: Install UV
|
- name: Create output directories
|
||||||
run: |
|
run: |
|
||||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
mkdir -p ./html ./tmp
|
||||||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
|
||||||
|
|
||||||
- name: Install Python dependencies
|
- name: Build man pages in container
|
||||||
run: |
|
run: |
|
||||||
uv pip install --system -e .
|
docker run --rm \
|
||||||
|
-v "$(pwd)/html:/data/html" \
|
||||||
- name: Build man pages
|
-v "$(pwd)/tmp:/data/tmp" \
|
||||||
run: |
|
rocky-man:latest \
|
||||||
python3.11 -m rocky_man.main \
|
--versions ${{ github.event.inputs.versions || '8.10 9.6 10.0' }} \
|
||||||
--versions ${{ github.event.inputs.versions || '8.10 9.5' }} \
|
|
||||||
--output-dir ./html \
|
|
||||||
--download-dir ./tmp/downloads \
|
|
||||||
--extract-dir ./tmp/extracts \
|
|
||||||
--verbose
|
--verbose
|
||||||
env:
|
env:
|
||||||
PYTHONUNBUFFERED: 1
|
PYTHONUNBUFFERED: 1
|
||||||
@@ -68,11 +55,3 @@ jobs:
|
|||||||
name: rocky-man-pages
|
name: rocky-man-pages
|
||||||
path: html/
|
path: html/
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
- name: Deploy to GitHub Pages
|
|
||||||
if: github.ref == 'refs/heads/main'
|
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
publish_dir: ./html
|
|
||||||
force_orphan: true
|
|
||||||
|
|||||||
BIN
.ruff_cache/0.12.5/7088262797167738659
Normal file
BIN
.ruff_cache/0.12.5/7088262797167738659
Normal file
Binary file not shown.
155
Jenkinsfile
vendored
Normal file
155
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
// Jenkinsfile for Rocky Man
|
||||||
|
pipeline {
|
||||||
|
agent {
|
||||||
|
kubernetes {
|
||||||
|
yaml """
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
jenkins: agent
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: docker
|
||||||
|
image: docker:24-dind
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
volumeMounts:
|
||||||
|
- name: docker-sock
|
||||||
|
mountPath: /var/run
|
||||||
|
command:
|
||||||
|
- dockerd-entrypoint.sh
|
||||||
|
- name: docker-cli
|
||||||
|
image: docker:24-cli
|
||||||
|
command:
|
||||||
|
- cat
|
||||||
|
tty: true
|
||||||
|
volumeMounts:
|
||||||
|
- name: docker-sock
|
||||||
|
mountPath: /var/run
|
||||||
|
- name: b2
|
||||||
|
image: backblazeit/b2:latest
|
||||||
|
command:
|
||||||
|
- cat
|
||||||
|
tty: true
|
||||||
|
volumes:
|
||||||
|
- name: docker-sock
|
||||||
|
emptyDir: {}
|
||||||
|
"""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parameters {
|
||||||
|
string(
|
||||||
|
name: 'VERSIONS',
|
||||||
|
defaultValue: '8.10 9.6 10.1',
|
||||||
|
description: 'Rocky Linux versions to build (space-separated)'
|
||||||
|
)
|
||||||
|
string(
|
||||||
|
name: 'B2_BUCKET_NAME',
|
||||||
|
defaultValue: 'rockyman',
|
||||||
|
description: 'B2 bucket name for uploads'
|
||||||
|
)
|
||||||
|
string(
|
||||||
|
name: 'EXISTING_VERSIONS',
|
||||||
|
defaultValue: '',
|
||||||
|
description: 'Existing versions already built (space-separated)'
|
||||||
|
)
|
||||||
|
string(
|
||||||
|
name: 'PARALLEL_DOWNLOADS',
|
||||||
|
defaultValue: '5',
|
||||||
|
description: 'Number of parallel downloads'
|
||||||
|
)
|
||||||
|
string(
|
||||||
|
name: 'PARALLEL_CONVERSIONS',
|
||||||
|
defaultValue: '10',
|
||||||
|
description: 'Number of parallel conversions'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
options {
|
||||||
|
buildDiscarder(logRotator(numToKeepStr: '10'))
|
||||||
|
timeout(time: 2, unit: 'HOURS')
|
||||||
|
}
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage('Checkout') {
|
||||||
|
steps {
|
||||||
|
checkout scm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build Docker Image') {
|
||||||
|
steps {
|
||||||
|
container('docker-cli') {
|
||||||
|
sh '''
|
||||||
|
docker build -t rocky-man:${BUILD_NUMBER} .
|
||||||
|
docker tag rocky-man:${BUILD_NUMBER} rocky-man:latest
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build Man Pages') {
|
||||||
|
steps {
|
||||||
|
container('docker-cli') {
|
||||||
|
sh '''
|
||||||
|
# Create output directories
|
||||||
|
mkdir -p ./html ./tmp
|
||||||
|
|
||||||
|
# Run the container to build man pages
|
||||||
|
docker run --rm \
|
||||||
|
-v "$(pwd)/html:/app/html" \
|
||||||
|
-v "$(pwd)/tmp:/data/tmp" \
|
||||||
|
rocky-man:${BUILD_NUMBER} \
|
||||||
|
--versions ${VERSIONS} \
|
||||||
|
--verbose \
|
||||||
|
--parallel-downloads ${PARALLEL_DOWNLOADS} \
|
||||||
|
--parallel-conversions ${PARALLEL_CONVERSIONS} \
|
||||||
|
--existing-versions "${EXISTING_VERSIONS}"
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Upload to B2') {
|
||||||
|
when {
|
||||||
|
expression { return params.B2_BUCKET_NAME != "" }
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
container('docker-cli') {
|
||||||
|
withCredentials([
|
||||||
|
string(credentialsId: 'b2-app-id', variable: 'B2_APPLICATION_KEY_ID'),
|
||||||
|
string(credentialsId: 'b2-app-key', variable: 'B2_APPLICATION_KEY')
|
||||||
|
]) {
|
||||||
|
sh '''
|
||||||
|
docker run --rm \
|
||||||
|
-v "$(pwd)/html:/workspace/html" \
|
||||||
|
-e B2_APPLICATION_KEY \
|
||||||
|
-e B2_APPLICATION_KEY_ID \
|
||||||
|
backblazeit/b2:latest \
|
||||||
|
b2v4 sync /workspace/html/ "b2://${B2_BUCKET_NAME}/"
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
post {
|
||||||
|
success {
|
||||||
|
echo 'Build completed and uploaded to B2!'
|
||||||
|
}
|
||||||
|
failure {
|
||||||
|
echo 'Build failed!'
|
||||||
|
}
|
||||||
|
cleanup {
|
||||||
|
container('docker-cli') {
|
||||||
|
sh '''
|
||||||
|
docker rmi rocky-man:${BUILD_NUMBER} || true
|
||||||
|
docker rmi rocky-man:latest || true
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
42
README.md
42
README.md
@@ -162,38 +162,40 @@ usage: rocky-man [-h] [--versions VERSIONS [VERSIONS ...]]
|
|||||||
|
|
||||||
Generate HTML documentation for Rocky Linux man pages
|
Generate HTML documentation for Rocky Linux man pages
|
||||||
|
|
||||||
optional arguments:
|
Options:
|
||||||
-h, --help show this help message and exit
|
-h, --help Show this help message and exit
|
||||||
|
|
||||||
--versions VERSIONS [VERSIONS ...]
|
--versions VERSIONS [VERSIONS ...]
|
||||||
Rocky Linux versions to process (default: 8.10 9.6 10.0)
|
Rocky Linux versions to process (default: 8.10 9.6 10.0)
|
||||||
|
|
||||||
--repo-types REPO_TYPES [REPO_TYPES ...]
|
--repo-types REPO_TYPES [REPO_TYPES ...]
|
||||||
Repository types to process (default: BaseOS AppStream)
|
Repository types to process (default: BaseOS AppStream)
|
||||||
|
|
||||||
--output-dir OUTPUT_DIR
|
--output-dir OUTPUT_DIR
|
||||||
Output directory for HTML files (default: ./html)
|
HTML output directory (default: ./html)
|
||||||
|
|
||||||
--download-dir DOWNLOAD_DIR
|
--download-dir DOWNLOAD_DIR
|
||||||
Directory for downloading packages (default: ./tmp/downloads)
|
Package download directory (default: ./tmp/downloads)
|
||||||
|
|
||||||
--extract-dir EXTRACT_DIR
|
--extract-dir EXTRACT_DIR
|
||||||
Directory for extracting man pages (default: ./tmp/extracts)
|
Extraction directory (default: ./tmp/extracts)
|
||||||
|
|
||||||
--keep-rpms Keep downloaded RPM files after processing
|
--keep-rpms Keep downloaded RPM files after processing
|
||||||
|
|
||||||
--keep-extracts Keep extracted man files after processing
|
--keep-extracts Keep extracted man files after processing
|
||||||
--parallel-downloads PARALLEL_DOWNLOADS
|
|
||||||
|
--parallel-downloads N
|
||||||
Number of parallel downloads (default: 5)
|
Number of parallel downloads (default: 5)
|
||||||
--parallel-conversions PARALLEL_CONVERSIONS
|
|
||||||
|
--parallel-conversions N
|
||||||
Number of parallel HTML conversions (default: 10)
|
Number of parallel HTML conversions (default: 10)
|
||||||
--mirror MIRROR Rocky Linux mirror URL (default: http://dl.rockylinux.org/)
|
|
||||||
--vault Use vault directory instead of pub (vault/rocky instead of pub/rocky)
|
--mirror URL Rocky Linux mirror URL
|
||||||
--existing-versions [VERSION ...]
|
(default: http://dl.rockylinux.org/)
|
||||||
List of existing versions to include in root index (e.g., 8.10 9.7)
|
|
||||||
--template-dir TEMPLATE_DIR
|
--template-dir DIR Custom template directory
|
||||||
Template directory (default: ./templates)
|
|
||||||
-v, --verbose Enable verbose logging
|
-v, --verbose Enable verbose logging
|
||||||
--skip-sections [SKIP_SECTIONS ...]
|
|
||||||
Man sections to skip (default: 3 3p 3pm). Use empty list to skip none.
|
|
||||||
--skip-packages [SKIP_PACKAGES ...]
|
|
||||||
Package names to skip (default: lapack dpdk-devel gl-manpages). Use empty list to skip none.
|
|
||||||
--skip-languages Skip non-English man pages (default: enabled)
|
|
||||||
--keep-languages Keep all languages (disables --skip-languages)
|
|
||||||
--allow-all-sections Include all man sections (overrides --skip-sections)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|||||||
@@ -284,7 +284,8 @@ class WebGenerator:
|
|||||||
max_minors = max(len(major_to_minors[major]) for major in sorted_majors)
|
max_minors = max(len(major_to_minors[major]) for major in sorted_majors)
|
||||||
num_columns = len(sorted_majors)
|
num_columns = len(sorted_majors)
|
||||||
|
|
||||||
# Create rows of versions for side-by-side display
|
# Create rows for grid layout (each row has one version from each major)
|
||||||
|
# This creates the data structure for proper column grouping
|
||||||
version_rows = []
|
version_rows = []
|
||||||
for minor_idx in range(max_minors):
|
for minor_idx in range(max_minors):
|
||||||
row = []
|
row = []
|
||||||
@@ -293,7 +294,7 @@ class WebGenerator:
|
|||||||
if minor_idx < len(minors_list):
|
if minor_idx < len(minors_list):
|
||||||
row.append((major, minors_list[minor_idx]))
|
row.append((major, minors_list[minor_idx]))
|
||||||
else:
|
else:
|
||||||
row.append(None) # Empty cell placeholder
|
row.append(None) # Placeholder for empty cells
|
||||||
version_rows.append(row)
|
version_rows.append(row)
|
||||||
|
|
||||||
html = template.render(
|
html = template.render(
|
||||||
|
|||||||
@@ -174,8 +174,6 @@
|
|||||||
<div class="version-browse">Browse man pages →</div>
|
<div class="version-browse">Browse man pages →</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
|
||||||
<div></div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Reference in New Issue
Block a user