fix-build #1

Merged
admin merged 2 commits from fix-build into main 2025-11-24 15:20:20 -06:00
2 changed files with 114 additions and 8 deletions
Showing only changes of commit 29f299f984 - Show all commits

View File

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

114
Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,114 @@
// 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')
timestamps()
}
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 ${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
'''
}
}
}
}