|
15 | 15 | // specific language governing permissions and limitations |
16 | 16 | // under the License. |
17 | 17 |
|
| 18 | +def getGithubAndJiraCreds() { |
| 19 | + return [usernamePassword(credentialsId: 'apache-hadoop-at-github.com', |
| 20 | + passwordVariable: 'GITHUB_TOKEN', |
| 21 | + usernameVariable: 'GITHUB_USER'), |
| 22 | + usernamePassword(credentialsId: 'hadoopqa-at-asf-jira', |
| 23 | + passwordVariable: 'JIRA_PASSWORD', |
| 24 | + usernameVariable: 'JIRA_USER')] |
| 25 | +} |
| 26 | + |
18 | 27 | pipeline { |
19 | 28 |
|
20 | 29 | agent { |
@@ -103,18 +112,12 @@ pipeline { |
103 | 112 | } |
104 | 113 |
|
105 | 114 | steps { |
106 | | - withCredentials( |
107 | | - [usernamePassword(credentialsId: 'apache-hadoop-at-github.com', |
108 | | - passwordVariable: 'GITHUB_TOKEN', |
109 | | - usernameVariable: 'GITHUB_USER'), |
110 | | - usernamePassword(credentialsId: 'hadoopqa-at-asf-jira', |
111 | | - passwordVariable: 'JIRA_PASSWORD', |
112 | | - usernameVariable: 'JIRA_USER')]) { |
113 | | - sh '''#!/usr/bin/env bash |
| 115 | + withCredentials(getGithubAndJiraCreds()) { |
| 116 | + sh '''#!/usr/bin/env bash |
114 | 117 |
|
115 | | - chmod u+x "${SOURCEDIR}/dev-support/jenkins.sh" |
116 | | - "${SOURCEDIR}/dev-support/jenkins.sh" run_ci |
117 | | - ''' |
| 118 | + chmod u+x "${SOURCEDIR}/dev-support/jenkins.sh" |
| 119 | + "${SOURCEDIR}/dev-support/jenkins.sh" run_ci |
| 120 | + ''' |
118 | 121 | } |
119 | 122 | } |
120 | 123 |
|
@@ -155,13 +158,7 @@ pipeline { |
155 | 158 | } |
156 | 159 |
|
157 | 160 | steps { |
158 | | - withCredentials( |
159 | | - [usernamePassword(credentialsId: 'apache-hadoop-at-github.com', |
160 | | - passwordVariable: 'GITHUB_TOKEN', |
161 | | - usernameVariable: 'GITHUB_USER'), |
162 | | - usernamePassword(credentialsId: 'hadoopqa-at-asf-jira', |
163 | | - passwordVariable: 'JIRA_PASSWORD', |
164 | | - usernameVariable: 'JIRA_USER')]) { |
| 161 | + withCredentials(getGithubAndJiraCreds()) { |
165 | 162 | sh '''#!/usr/bin/env bash |
166 | 163 |
|
167 | 164 | chmod u+x "${SOURCEDIR}/dev-support/jenkins.sh" |
@@ -207,18 +204,12 @@ pipeline { |
207 | 204 | } |
208 | 205 |
|
209 | 206 | steps { |
210 | | - withCredentials( |
211 | | - [usernamePassword(credentialsId: 'apache-hadoop-at-github.com', |
212 | | - passwordVariable: 'GITHUB_TOKEN', |
213 | | - usernameVariable: 'GITHUB_USER'), |
214 | | - usernamePassword(credentialsId: 'hadoopqa-at-asf-jira', |
215 | | - passwordVariable: 'JIRA_PASSWORD', |
216 | | - usernameVariable: 'JIRA_USER')]) { |
217 | | - sh '''#!/usr/bin/env bash |
| 207 | + withCredentials(getGithubAndJiraCreds()) { |
| 208 | + sh '''#!/usr/bin/env bash |
218 | 209 |
|
219 | | - chmod u+x "${SOURCEDIR}/dev-support/jenkins.sh" |
220 | | - "${SOURCEDIR}/dev-support/jenkins.sh" run_ci |
221 | | - ''' |
| 210 | + chmod u+x "${SOURCEDIR}/dev-support/jenkins.sh" |
| 211 | + "${SOURCEDIR}/dev-support/jenkins.sh" run_ci |
| 212 | + ''' |
222 | 213 | } |
223 | 214 | } |
224 | 215 |
|
@@ -256,18 +247,12 @@ pipeline { |
256 | 247 | } |
257 | 248 |
|
258 | 249 | steps { |
259 | | - withCredentials( |
260 | | - [usernamePassword(credentialsId: 'apache-hadoop-at-github.com', |
261 | | - passwordVariable: 'GITHUB_TOKEN', |
262 | | - usernameVariable: 'GITHUB_USER'), |
263 | | - usernamePassword(credentialsId: 'hadoopqa-at-asf-jira', |
264 | | - passwordVariable: 'JIRA_PASSWORD', |
265 | | - usernameVariable: 'JIRA_USER')]) { |
266 | | - sh '''#!/usr/bin/env bash |
| 250 | + withCredentials(getGithubAndJiraCreds()) { |
| 251 | + sh '''#!/usr/bin/env bash |
267 | 252 |
|
268 | | - chmod u+x "${SOURCEDIR}/dev-support/jenkins.sh" |
269 | | - "${SOURCEDIR}/dev-support/jenkins.sh" run_ci |
270 | | - ''' |
| 253 | + chmod u+x "${SOURCEDIR}/dev-support/jenkins.sh" |
| 254 | + "${SOURCEDIR}/dev-support/jenkins.sh" run_ci |
| 255 | + ''' |
271 | 256 | } |
272 | 257 | } |
273 | 258 |
|
|
0 commit comments