Update Jenkinsfile
This commit is contained in:
21
Jenkinsfile
vendored
21
Jenkinsfile
vendored
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user