Compare commits
7 Commits
add-feedba
...
9e2943754f
| Author | SHA1 | Date | |
|---|---|---|---|
| 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
|
|
||||||
|
|||||||
113
Jenkinsfile
vendored
Normal file
113
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
// Jenkinsfile for Rocky Man
|
||||||
|
// This pipeline uses Kubernetes agents to build and run the container
|
||||||
|
|
||||||
|
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
|
||||||
|
volumes:
|
||||||
|
- name: docker-sock
|
||||||
|
emptyDir: {}
|
||||||
|
"""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parameters {
|
||||||
|
string(
|
||||||
|
name: 'VERSIONS',
|
||||||
|
defaultValue: '8.10 9.6 10.0',
|
||||||
|
description: 'Rocky Linux versions to build (space-separated)'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
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:/data/html" \
|
||||||
|
-v "\$(pwd)/tmp:/data/tmp" \
|
||||||
|
rocky-man:${BUILD_NUMBER} \
|
||||||
|
--versions ${params.VERSIONS} \
|
||||||
|
--verbose
|
||||||
|
"""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Archive Artifacts') {
|
||||||
|
steps {
|
||||||
|
archiveArtifacts artifacts: 'html/**/*', fingerprint: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
post {
|
||||||
|
success {
|
||||||
|
echo 'Build completed successfully!'
|
||||||
|
}
|
||||||
|
failure {
|
||||||
|
echo 'Build failed!'
|
||||||
|
}
|
||||||
|
cleanup {
|
||||||
|
container('docker-cli') {
|
||||||
|
sh '''
|
||||||
|
# Clean up Docker images to save space
|
||||||
|
docker rmi rocky-man:${BUILD_NUMBER} || true
|
||||||
|
docker rmi rocky-man:latest || true
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user