Compare commits

..

21 Commits

Author SHA1 Message Date
Stephen Simpson
e356431b72 Refactor Rocky Man Page Generator
- Improved logging and error handling in main.py, including better version management and configuration handling.
- Enhanced RepoManager to dynamically switch between pub and vault repositories for package retrieval.
- Updated ManPageConverter to handle symlink detection and generate appropriate redirect HTML.
- Refined WebGenerator to support dynamic version grid layout and improved HTML generation for man pages and indexes.
- Modified templates to remove trademark symbols and enhance styling for version cards.
- Added support for existing versions in the root index generation.

Signed-off-by: Stephen Simpson <ssimpson89@users.noreply.github.com>
2025-12-04 17:04:55 -06:00
Stephen Simpson
89404a2042 update 2025-12-04 17:02:29 -06:00
c6dc7fe310 Remove parameter for parallel conversions from Jenkinsfile
Signed-off-by: Stephen Simpson <stevo81989@gmail.com>
2025-11-26 10:57:16 -06:00
411abf8683 Update Jenkinsfile to change parameter types for parallel downloads and conversions to strings
Signed-off-by: Stephen Simpson <stevo81989@gmail.com>
2025-11-26 10:55:43 -06:00
c3fef46d6a Update Jenkinsfile to modify default Rocky Linux version and add parameters for parallel downloads and conversions
Signed-off-by: Stephen Simpson <stevo81989@gmail.com>
2025-11-26 10:49:36 -06:00
a0994a5c16 Update Jenkinsfile 2025-11-25 13:41:19 -06:00
7bda4a1155 Update Jenkinsfile 2025-11-25 13:33:44 -06:00
3f2ecebb08 Update Jenkinsfile 2025-11-25 13:32:23 -06:00
c9b59737b9 Update Jenkinsfile 2025-11-25 11:52:39 -06:00
067965d983 Update Jenkinsfile 2025-11-25 11:50:10 -06:00
b9f6697100 Update Jenkinsfile 2025-11-25 10:54:31 -06:00
106e680f11 Update Jenkinsfile 2025-11-25 08:28:52 -06:00
b1e987f1b1 Merge pull request 'update' (#4) from fix-build into main
Reviewed-on: #4
2025-11-24 16:28:33 -06:00
Stephen Simpson
13308d4b4b update 2025-11-24 16:28:17 -06:00
9e2943754f Merge pull request 'update' (#3) from fix-build into main
Reviewed-on: #3
2025-11-24 15:52:56 -06:00
Stephen Simpson
b20a70b860 update 2025-11-24 15:52:42 -06:00
b371431aa5 Merge pull request 'update' (#2) from fix-build into main
Reviewed-on: #2
2025-11-24 15:27:06 -06:00
Stephen Simpson
c86868b11c update 2025-11-24 15:26:41 -06:00
2315422d4f Merge pull request 'fix-build' (#1) from fix-build into main
Reviewed-on: #1
2025-11-24 15:20:19 -06:00
Stephen Simpson
29f299f984 Remove GitHub Pages deployment step from build workflow and add Jenkinsfile for Kubernetes-based builds
Signed-off-by: Stephen Simpson <ssimpson89@users.noreply.github.com>
2025-11-24 15:19:32 -06:00
Stephen Simpson
8428dc9b1a Refactor GitHub Actions workflow to build Docker image and run man page generation in container
Signed-off-by: Stephen Simpson <ssimpson89@users.noreply.github.com>
2025-11-24 15:01:08 -06:00
6 changed files with 190 additions and 55 deletions

View File

@@ -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

Binary file not shown.

155
Jenkinsfile vendored Normal file
View 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
'''
}
}
}
}

View File

@@ -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

View File

@@ -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(

View File

@@ -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 %}