Skip to content

Commit

Permalink
Add blobxfer to Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
olblak committed Sep 20, 2017
1 parent 3657fc3 commit 43b67e6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 * * * *')]))
Expand Down Expand Up @@ -99,14 +97,16 @@ try {
sh 'echo "put build/archives/*.zip archives/" | sftp -o StrictHostKeyChecking=no [email protected]'
}
}
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}"
Expand Down

0 comments on commit 43b67e6

Please sign in to comment.