Update Jenkinsfile

This commit is contained in:
2025-11-25 11:50:10 -06:00
parent b9f6697100
commit 067965d983

23
Jenkinsfile vendored
View File

@@ -102,7 +102,7 @@ spec:
// } // }
//} //}
stage('Upload to B2') { stage('Upload to B2') {
steps { steps {
container('b2') { container('b2') {
withCredentials([ withCredentials([
@@ -110,18 +110,27 @@ spec:
string(credentialsId: 'b2-app-key', variable: 'B2_APPLICATION_KEY') string(credentialsId: 'b2-app-key', variable: 'B2_APPLICATION_KEY')
]) { ]) {
sh ''' sh '''
b2 authorize-account ${B2_APPLICATION_ID} ${B2_APPLICATION_KEY} # Modern B2 command (replaces deprecated authorize-account)
b2 sync \ b2 account authorize-account-key \\
--allowEmptySource \ --applicationKeyId ${B2_APPLICATION_ID} \\
--compareVersions size \ --key ${B2_APPLICATION_KEY}
./html/ \
# Sync HTML contents (not the directory)
b2 sync \\
--allowEmptySource \\
--compareVersions size \\
--skip-perms \\
--threads 10 \\
./html/ \\
b2://${B2_BUCKET_NAME}/builds/${BUILD_NUMBER}/ b2://${B2_BUCKET_NAME}/builds/${BUILD_NUMBER}/
# Optional: List the uploaded files to verify
b2 ls b2://${B2_BUCKET_NAME}/builds/${BUILD_NUMBER}
''' '''
} }
} }
} }
} }
}
post { post {
success { success {