Update Jenkinsfile

This commit is contained in:
2025-11-25 08:28:52 -06:00
parent b1e987f1b1
commit 106e680f11

36
Jenkinsfile vendored
View File

@@ -29,6 +29,11 @@ spec:
volumeMounts:
- name: docker-sock
mountPath: /var/run
- name: b2
image: backblazeit/b2:latest
command:
- cat
tty: true
volumes:
- name: docker-sock
emptyDir: {}
@@ -42,6 +47,11 @@ spec:
defaultValue: '8.10 9.6 10.0',
description: 'Rocky Linux versions to build (space-separated)'
)
string(
name: 'B2_BUCKET_NAME',
defaultValue: 'rockyman',
description: 'B2 bucket name for uploads'
)
}
options {
@@ -86,16 +96,36 @@ spec:
}
}
stage('Archive Artifacts') {
#stage('Archive Artifacts') {
# steps {
# archiveArtifacts artifacts: 'html/**/*', fingerprint: true
# }
#}
stage('Upload to B2') {
steps {
archiveArtifacts artifacts: 'html/**/*', fingerprint: true
container('b2') {
withCredentials([
string(credentialsId: 'b2-app-id', variable: 'B2_APPLICATION_ID'),
string(credentialsId: 'b2-app-key', variable: 'B2_APPLICATION_KEY')
]) {
sh '''
b2 authorize-account ${B2_APPLICATION_ID} ${B2_APPLICATION_KEY}
b2 sync \
--allowEmptySource \
--compareVersions size \
./html/ \
b2://${B2_BUCKET_NAME}/builds/${BUILD_NUMBER}/
'''
}
}
}
}
}
post {
success {
echo 'Build completed successfully!'
echo 'Build completed successfully and uploaded to B2!'
}
failure {
echo 'Build failed!'