Skip to content

Commit

Permalink
Merge pull request #3 from wearefine/2_curl_r10k_webhook
Browse files Browse the repository at this point in the history
Updated r10k curl command
  • Loading branch information
cpitkin authored Jul 6, 2020
2 parents c3d6828 + 8ca0e25 commit 9c044aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vars/puppet.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def call(body) {
}
if (config.R10K_DEPLOY_BASIC_AUTH_CRED_ID) {
withCredentials([string(credentialsId: config.R10K_DEPLOY_BASIC_AUTH_CRED_ID, variable: 'basic_auth')]) {
config.BASIC_AUTH_HEADER = "--header \'authorization: ${basic_auth}\'"
config.BASIC_AUTH_HEADER = "--header \"Authorization: Basic ${basic_auth}\""
}
} else {
config.BASIC_AUTH_HEADER = ''
Expand Down Expand Up @@ -155,7 +155,7 @@ def call(body) {
milestone label: 'Deploy'
def deploy_branch = config.R10K_DEPLOY_BRANCH.any {it == env.BRANCH_NAME}
if (deploy_branch) {
sh returnStdout: true, script: "curl --request POST -k --url ${config.R10K_DEPLOY_URL}/payload --header \'content-type: application/json\' ${config.BASIC_AUTH_HEADER} --data \'{\"push\":{\"changes\":[{\"new\":{\"name\":\"${env.BRANCH_NAME}\"}}]}}\'"
sh returnStdout: true, script: "curl --request POST -k --url ${config.R10K_DEPLOY_URL}/payload --header \"Content-Type: application/json\" ${config.BASIC_AUTH_HEADER} --data \"{\"push\":{\"changes\":[{\"new\":{\"name\":\"${env.BRANCH_NAME}\"}}]}}\""
currentBuild.result = 'SUCCESS'
}
}
Expand Down

0 comments on commit 9c044aa

Please sign in to comment.