From ad8aaf878edfbabf74ca6deb423db0fc3d761a42 Mon Sep 17 00:00:00 2001 From: "Sakthipriyan Vairamani (thefourtheye)" Date: Tue, 15 Jan 2019 13:26:08 +0530 Subject: [PATCH] scripts: fix reading credentials for jenkins The existing code assumes that the credentials are already in base64, but they are actually not. The code has to read the credentials in plain text and base 64 encode them. --- scripts/trigger-jenkins-build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/trigger-jenkins-build.js b/scripts/trigger-jenkins-build.js index cad8a93a..c7724fcb 100644 --- a/scripts/trigger-jenkins-build.js +++ b/scripts/trigger-jenkins-build.js @@ -52,7 +52,7 @@ function buildParametersForRepo (options, repo) { function triggerBuild (options, cb) { const { repo } = options - const base64Credentials = Buffer.from(jenkinsApiCredentials, 'base64') + const base64Credentials = Buffer.from(jenkinsApiCredentials).toString('base64') const authorization = `Basic ${base64Credentials}` const jobName = getJobNameForRepo(repo)