Compare commits
14 Commits
fix-build
...
c6dc7fe310
| Author | SHA1 | Date | |
|---|---|---|---|
| c6dc7fe310 | |||
| 411abf8683 | |||
| c3fef46d6a | |||
| a0994a5c16 | |||
| 7bda4a1155 | |||
| 3f2ecebb08 | |||
| c9b59737b9 | |||
| 067965d983 | |||
| b9f6697100 | |||
| 106e680f11 | |||
| b1e987f1b1 | |||
| 9e2943754f | |||
| b371431aa5 | |||
| 2315422d4f |
62
Jenkinsfile
vendored
62
Jenkinsfile
vendored
@@ -1,6 +1,4 @@
|
|||||||
// Jenkinsfile for Rocky Man
|
// Jenkinsfile for Rocky Man
|
||||||
// This pipeline uses Kubernetes agents to build and run the container
|
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent {
|
agent {
|
||||||
kubernetes {
|
kubernetes {
|
||||||
@@ -29,6 +27,11 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: docker-sock
|
- name: docker-sock
|
||||||
mountPath: /var/run
|
mountPath: /var/run
|
||||||
|
- name: b2
|
||||||
|
image: backblazeit/b2:latest
|
||||||
|
command:
|
||||||
|
- cat
|
||||||
|
tty: true
|
||||||
volumes:
|
volumes:
|
||||||
- name: docker-sock
|
- name: docker-sock
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
@@ -39,9 +42,24 @@ spec:
|
|||||||
parameters {
|
parameters {
|
||||||
string(
|
string(
|
||||||
name: 'VERSIONS',
|
name: 'VERSIONS',
|
||||||
defaultValue: '8.10 9.6 10.0',
|
defaultValue: '8.10 9.6 10.1',
|
||||||
description: 'Rocky Linux versions to build (space-separated)'
|
description: 'Rocky Linux versions to build (space-separated)'
|
||||||
)
|
)
|
||||||
|
string(
|
||||||
|
name: 'B2_BUCKET_NAME',
|
||||||
|
defaultValue: 'rockyman',
|
||||||
|
description: 'B2 bucket name for uploads'
|
||||||
|
)
|
||||||
|
string(
|
||||||
|
name: 'PARALLEL_DOWNLOADS',
|
||||||
|
defaultValue: '5',
|
||||||
|
description: 'Number of parallel downloads'
|
||||||
|
)
|
||||||
|
string(
|
||||||
|
name: 'PARALLEL_CONVERSIONS',
|
||||||
|
defaultValue: '10',
|
||||||
|
description: 'Number of parallel conversions'
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
options {
|
options {
|
||||||
@@ -70,32 +88,51 @@ spec:
|
|||||||
stage('Build Man Pages') {
|
stage('Build Man Pages') {
|
||||||
steps {
|
steps {
|
||||||
container('docker-cli') {
|
container('docker-cli') {
|
||||||
sh """
|
sh '''
|
||||||
# Create output directories
|
# Create output directories
|
||||||
mkdir -p ./html ./tmp
|
mkdir -p ./html ./tmp
|
||||||
|
|
||||||
# Run the container to build man pages
|
# Run the container to build man pages
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-v "\$(pwd)/html:/app/html" \
|
-v "$(pwd)/html:/app/html" \
|
||||||
-v "\$(pwd)/tmp:/data/tmp" \
|
-v "$(pwd)/tmp:/data/tmp" \
|
||||||
rocky-man:${BUILD_NUMBER} \
|
rocky-man:${BUILD_NUMBER} \
|
||||||
--versions ${params.VERSIONS} \
|
--versions ${VERSIONS} \
|
||||||
--verbose
|
--verbose \
|
||||||
"""
|
--parallel-downloads ${PARALLEL_DOWNLOADS} \
|
||||||
|
--parallel-conversions ${PARALLEL_CONVERSIONS}
|
||||||
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Archive Artifacts') {
|
stage('Upload to B2') {
|
||||||
|
when {
|
||||||
|
expression { return params.B2_BUCKET_NAME != "" }
|
||||||
|
}
|
||||||
steps {
|
steps {
|
||||||
archiveArtifacts artifacts: 'html/**/*', fingerprint: true
|
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 {
|
post {
|
||||||
success {
|
success {
|
||||||
echo 'Build completed successfully!'
|
echo 'Build completed and uploaded to B2!'
|
||||||
}
|
}
|
||||||
failure {
|
failure {
|
||||||
echo 'Build failed!'
|
echo 'Build failed!'
|
||||||
@@ -103,7 +140,6 @@ spec:
|
|||||||
cleanup {
|
cleanup {
|
||||||
container('docker-cli') {
|
container('docker-cli') {
|
||||||
sh '''
|
sh '''
|
||||||
# Clean up Docker images to save space
|
|
||||||
docker rmi rocky-man:${BUILD_NUMBER} || true
|
docker rmi rocky-man:${BUILD_NUMBER} || true
|
||||||
docker rmi rocky-man:latest || true
|
docker rmi rocky-man:latest || true
|
||||||
'''
|
'''
|
||||||
|
|||||||
Reference in New Issue
Block a user