Update Jenkinsfile
This commit is contained in:
42
Jenkinsfile
vendored
42
Jenkinsfile
vendored
@@ -87,55 +87,41 @@ docker run --rm \\
|
||||
-v \"\$(pwd)/html:/app/html\" \\
|
||||
-v \"\$(pwd)/tmp:/data/tmp\" \\
|
||||
rocky-man:${BUILD_NUMBER} \\
|
||||
--versions ${params.VERSIONS} \\
|
||||
--versions \"${params.VERSIONS}\" \\
|
||||
--verbose
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Archive Artifacts') {
|
||||
steps {
|
||||
archiveArtifacts artifacts: 'html/**/*', fingerprint: true, allowEmptyArchive: true
|
||||
}
|
||||
}
|
||||
// stage('Archive Artifacts') {
|
||||
// steps {
|
||||
// archiveArtifacts artifacts: 'html/**/*', fingerprint: true, allowEmptyArchive: true
|
||||
// }
|
||||
// }
|
||||
|
||||
stage('Upload to B2') {
|
||||
when {
|
||||
expression { return params.B2_BUCKET_NAME != "" }
|
||||
}
|
||||
steps {
|
||||
container('b2') {
|
||||
container('docker-cli') {
|
||||
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')
|
||||
]) {
|
||||
sh '''
|
||||
# Modern B2 auth command
|
||||
b2 account authorize-account-key \\
|
||||
--applicationKeyId ${B2_APPLICATION_ID} \\
|
||||
--key ${B2_APPLICATION_KEY}
|
||||
|
||||
# Verify auth (should succeed)
|
||||
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}
|
||||
docker run --rm \
|
||||
-v "$(pwd)/html:/workspace/html" \
|
||||
-e B2_APPLICATION_KEY \
|
||||
-e B2_APPLICATION_KEY_ID \
|
||||
backblazeit/b2:latest \
|
||||
b2v4 sync /workspace/html/ "b2://${B2_BUCKET_NAME}/"
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
success {
|
||||
|
||||
Reference in New Issue
Block a user