Compare commits

..

24 Commits

Author SHA1 Message Date
Stephen Simpson
4d7c526b0e Improve README.md: Update command-line options for clarity and add new arguments
Signed-off-by: Stephen Simpson <ssimpson89@users.noreply.github.com>
2025-12-05 09:40:02 -06:00
Stephen Simpson
c494e55e35 CUSP-1344 - Fix version layout on homepage
Signed-off-by: Stephen Simpson <ssimpson89@users.noreply.github.com>
2025-12-05 09:39:47 -06:00
Stephen Simpson
24ad0e6861 CUSP-1345 CUSP-1343 CUSP-1344 - Add older version ability
Signed-off-by: Stephen Simpson <ssimpson89@users.noreply.github.com>
2025-12-05 09:39:28 -06:00
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
5 changed files with 168 additions and 35 deletions

View File

@@ -25,39 +25,26 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container:
image: rockylinux:9
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install system dependencies
- name: Build Docker image
run: |
dnf install -y \
python3.11 \
python3.11-pip \
mandoc \
rpm-build \
dnf-plugins-core \
git
docker build -t rocky-man:latest .
- name: Install UV
- name: Create output directories
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
mkdir -p ./html ./tmp
- name: Install Python dependencies
- name: Build man pages in container
run: |
uv pip install --system -e .
- name: Build man pages
run: |
python3.11 -m rocky_man.main \
--versions ${{ github.event.inputs.versions || '8.10 9.5' }} \
--output-dir ./html \
--download-dir ./tmp/downloads \
--extract-dir ./tmp/extracts \
docker run --rm \
-v "$(pwd)/html:/data/html" \
-v "$(pwd)/tmp:/data/tmp" \
rocky-man:latest \
--versions ${{ github.event.inputs.versions || '8.10 9.6 10.0' }} \
--verbose
env:
PYTHONUNBUFFERED: 1
@@ -68,11 +55,3 @@ jobs:
name: rocky-man-pages
path: html/
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

@@ -284,7 +284,8 @@ class WebGenerator:
max_minors = max(len(major_to_minors[major]) for major in 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 = []
for minor_idx in range(max_minors):
row = []
@@ -293,7 +294,7 @@ class WebGenerator:
if minor_idx < len(minors_list):
row.append((major, minors_list[minor_idx]))
else:
row.append(None) # Empty cell placeholder
row.append(None) # Placeholder for empty cells
version_rows.append(row)
html = template.render(

View File

@@ -174,8 +174,6 @@
<div class="version-browse">Browse man pages →</div>
{% endif %}
</a>
{% else %}
<div></div>
{% endif %}
{% endfor %}
{% endfor %}