Update Jenkinsfile

This commit is contained in:
2025-11-25 13:32:23 -06:00
parent c9b59737b9
commit 3f2ecebb08

42
Jenkinsfile vendored
View File

@@ -87,55 +87,41 @@ 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 \"${params.VERSIONS}\" \\
--verbose --verbose
""" """
} }
} }
} }
stage('Archive Artifacts') { // stage('Archive Artifacts') {
steps { // steps {
archiveArtifacts artifacts: 'html/**/*', fingerprint: true, allowEmptyArchive: true // archiveArtifacts artifacts: 'html/**/*', fingerprint: true, allowEmptyArchive: true
} // }
} // }
stage('Upload to B2') { stage('Upload to B2') {
when { when {
expression { return params.B2_BUCKET_NAME != "" } expression { return params.B2_BUCKET_NAME != "" }
} }
steps { steps {
container('b2') { container('docker-cli') {
withCredentials([ withCredentials([
string(credentialsId: 'b2-app-id', variable: 'B2_APPLICATION_ID'), string(credentialsId: 'b2-app-id', variable: 'B2_APPLICATION_KEY_ID'),
string(credentialsId: 'b2-app-key', variable: 'B2_APPLICATION_KEY') string(credentialsId: 'b2-app-key', variable: 'B2_APPLICATION_KEY')
]) { ]) {
sh ''' sh '''
# Modern B2 auth command docker run --rm \
b2 account authorize-account-key \\ -v "$(pwd)/html:/workspace/html" \
--applicationKeyId ${B2_APPLICATION_ID} \\ -e B2_APPLICATION_KEY \
--key ${B2_APPLICATION_KEY} -e B2_APPLICATION_KEY_ID \
backblazeit/b2:latest \
# Verify auth (should succeed) b2v4 sync /workspace/html/ "b2://${B2_BUCKET_NAME}/"
b2 account get-account-info
# Sync HTML contents
b2 sync \\
--allowEmptySource \\
--compareVersions size \\
--skip-perms \\
--threads 10 \\
./html/ \\
b2://${B2_BUCKET_NAME}/builds/${BUILD_NUMBER}/
# Verify upload
b2 ls b2://${B2_BUCKET_NAME}/builds/${BUILD_NUMBER}
''' '''
} }
} }
} }
} }
}
post { post {
success { success {