Update Jenkinsfile

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

38
Jenkinsfile vendored
View File

@@ -29,6 +29,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: {}
@@ -42,6 +47,11 @@ spec:
defaultValue: '8.10 9.6 10.0', defaultValue: '8.10 9.6 10.0',
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'
)
} }
options { options {
@@ -86,16 +96,36 @@ spec:
} }
} }
stage('Archive Artifacts') { #stage('Archive Artifacts') {
# steps {
# archiveArtifacts artifacts: 'html/**/*', fingerprint: true
# }
#}
stage('Upload to B2') {
steps { 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 { post {
success { success {
echo 'Build completed successfully!' echo 'Build completed successfully and uploaded to B2!'
} }
failure { failure {
echo 'Build failed!' echo 'Build failed!'
@@ -110,4 +140,4 @@ spec:
} }
} }
} }
} }