HADOOP-17787. Refactor fetching of credentials in Jenkins (#3167)
This commit is contained in:
parent
b0b867e977
commit
4fd97e01e5
|
@ -15,6 +15,15 @@
|
||||||
// specific language governing permissions and limitations
|
// specific language governing permissions and limitations
|
||||||
// under the License.
|
// under the License.
|
||||||
|
|
||||||
|
def getGithubAndJiraCreds() {
|
||||||
|
return [usernamePassword(credentialsId: 'apache-hadoop-at-github.com',
|
||||||
|
passwordVariable: 'GITHUB_TOKEN',
|
||||||
|
usernameVariable: 'GITHUB_USER'),
|
||||||
|
usernamePassword(credentialsId: 'hadoopqa-at-asf-jira',
|
||||||
|
passwordVariable: 'JIRA_PASSWORD',
|
||||||
|
usernameVariable: 'JIRA_USER')]
|
||||||
|
}
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
|
|
||||||
agent {
|
agent {
|
||||||
|
@ -103,18 +112,12 @@ pipeline {
|
||||||
}
|
}
|
||||||
|
|
||||||
steps {
|
steps {
|
||||||
withCredentials(
|
withCredentials(getGithubAndJiraCreds()) {
|
||||||
[usernamePassword(credentialsId: 'apache-hadoop-at-github.com',
|
sh '''#!/usr/bin/env bash
|
||||||
passwordVariable: 'GITHUB_TOKEN',
|
|
||||||
usernameVariable: 'GITHUB_USER'),
|
|
||||||
usernamePassword(credentialsId: 'hadoopqa-at-asf-jira',
|
|
||||||
passwordVariable: 'JIRA_PASSWORD',
|
|
||||||
usernameVariable: 'JIRA_USER')]) {
|
|
||||||
sh '''#!/usr/bin/env bash
|
|
||||||
|
|
||||||
chmod u+x "${SOURCEDIR}/dev-support/jenkins.sh"
|
chmod u+x "${SOURCEDIR}/dev-support/jenkins.sh"
|
||||||
"${SOURCEDIR}/dev-support/jenkins.sh" run_ci
|
"${SOURCEDIR}/dev-support/jenkins.sh" run_ci
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,13 +158,7 @@ pipeline {
|
||||||
}
|
}
|
||||||
|
|
||||||
steps {
|
steps {
|
||||||
withCredentials(
|
withCredentials(getGithubAndJiraCreds()) {
|
||||||
[usernamePassword(credentialsId: 'apache-hadoop-at-github.com',
|
|
||||||
passwordVariable: 'GITHUB_TOKEN',
|
|
||||||
usernameVariable: 'GITHUB_USER'),
|
|
||||||
usernamePassword(credentialsId: 'hadoopqa-at-asf-jira',
|
|
||||||
passwordVariable: 'JIRA_PASSWORD',
|
|
||||||
usernameVariable: 'JIRA_USER')]) {
|
|
||||||
sh '''#!/usr/bin/env bash
|
sh '''#!/usr/bin/env bash
|
||||||
|
|
||||||
chmod u+x "${SOURCEDIR}/dev-support/jenkins.sh"
|
chmod u+x "${SOURCEDIR}/dev-support/jenkins.sh"
|
||||||
|
@ -207,18 +204,12 @@ pipeline {
|
||||||
}
|
}
|
||||||
|
|
||||||
steps {
|
steps {
|
||||||
withCredentials(
|
withCredentials(getGithubAndJiraCreds()) {
|
||||||
[usernamePassword(credentialsId: 'apache-hadoop-at-github.com',
|
sh '''#!/usr/bin/env bash
|
||||||
passwordVariable: 'GITHUB_TOKEN',
|
|
||||||
usernameVariable: 'GITHUB_USER'),
|
|
||||||
usernamePassword(credentialsId: 'hadoopqa-at-asf-jira',
|
|
||||||
passwordVariable: 'JIRA_PASSWORD',
|
|
||||||
usernameVariable: 'JIRA_USER')]) {
|
|
||||||
sh '''#!/usr/bin/env bash
|
|
||||||
|
|
||||||
chmod u+x "${SOURCEDIR}/dev-support/jenkins.sh"
|
chmod u+x "${SOURCEDIR}/dev-support/jenkins.sh"
|
||||||
"${SOURCEDIR}/dev-support/jenkins.sh" run_ci
|
"${SOURCEDIR}/dev-support/jenkins.sh" run_ci
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,18 +247,12 @@ pipeline {
|
||||||
}
|
}
|
||||||
|
|
||||||
steps {
|
steps {
|
||||||
withCredentials(
|
withCredentials(getGithubAndJiraCreds()) {
|
||||||
[usernamePassword(credentialsId: 'apache-hadoop-at-github.com',
|
sh '''#!/usr/bin/env bash
|
||||||
passwordVariable: 'GITHUB_TOKEN',
|
|
||||||
usernameVariable: 'GITHUB_USER'),
|
|
||||||
usernamePassword(credentialsId: 'hadoopqa-at-asf-jira',
|
|
||||||
passwordVariable: 'JIRA_PASSWORD',
|
|
||||||
usernameVariable: 'JIRA_USER')]) {
|
|
||||||
sh '''#!/usr/bin/env bash
|
|
||||||
|
|
||||||
chmod u+x "${SOURCEDIR}/dev-support/jenkins.sh"
|
chmod u+x "${SOURCEDIR}/dev-support/jenkins.sh"
|
||||||
"${SOURCEDIR}/dev-support/jenkins.sh" run_ci
|
"${SOURCEDIR}/dev-support/jenkins.sh" run_ci
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue