diff --git a/Jenkinsfile b/Jenkinsfile index ffb781d22a39..b08d0939c6d7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,8 +5,6 @@ def projectProperties = [ [$class: 'BuildDiscarderProperty',strategy: [$class: 'LogRotator', numToKeepStr: '5']], ] -def azure_storageaccount_name = 'prodjenkinsio' - if (!env.CHANGE_ID) { if (env.BRANCH_NAME == null) { projectProperties.add(pipelineTriggers([cron('H/30 * * * *')])) @@ -99,14 +97,16 @@ try { sh 'echo "put build/archives/*.zip archives/" | sftp -o StrictHostKeyChecking=no site-deployer@eggplant.jenkins.io' } } + stage('Publish on Azure') { + /* -> https://github.com/Azure/blobxfer + Require credential 'BLOBXFER_STORAGEACCOUNTKEY' set to the storage account key */ + withCredentials([string(credentialsId: 'BLOBXFER_STORAGEACCOUNTKEY', variable: 'BLOBXFER_STORAGEACCOUNTKEY')]) { + sh './scripts/blobxfer upload --local-path /data/_site --storage-account-key $BLOBXFER_STORAGEACCOUNTKEY --storage-account prodjenkinsio --remote-path jenkinsio --recursive --mode file --skip-on-md5-match --file-md5' + } + } } } - if (infra.isTrusted()) { - stage('Publish on Azure file') { - sh './scripts/az storage file upload-batch --account-name ${azure_storageaccount_name} -d jenkinsio -s /data/build/_site' - } - } } catch (exc) { echo "Caught: ${exc}"