mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 22:30:23 +00:00
ci: use the credentials-binding plugin for the GitHub API Token
The standard credentials() function does not seem to do what we need. So use the credentials-binding Jenkins plugin instead. See-also: https://www.jenkins.io/doc/pipeline/steps/credentials-binding/ Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
a6ca8e31dc
commit
ed671ec207
@ -16,11 +16,6 @@ def ssh(cmd) {
|
||||
sh "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${CICO_NODE} \"${cmd}\""
|
||||
}
|
||||
|
||||
environment {
|
||||
// "github-api-token" is a secret text credential configured in Jenkins
|
||||
GITHUB_API_TOKEN = credentials("github-api-token")
|
||||
}
|
||||
|
||||
node('cico-workspace') {
|
||||
stage('checkout ci repository') {
|
||||
git url: "${ci_git_repo}",
|
||||
@ -28,6 +23,8 @@ node('cico-workspace') {
|
||||
changelog: false
|
||||
}
|
||||
|
||||
// "github-api-token" is a secret text credential configured in Jenkins
|
||||
withCredentials([string(credentialsId: 'github-api-token', variable: 'GITHUB_API_TOKEN')]) {
|
||||
stage('skip ci/skip/e2e label') {
|
||||
if (params.ghprbPullId == null) {
|
||||
skip_e2e = 1
|
||||
@ -50,6 +47,7 @@ node('cico-workspace') {
|
||||
returnStdout: true).trim()
|
||||
echo "detected Kubernetes patch release: ${k8s_release}"
|
||||
}
|
||||
}
|
||||
|
||||
stage('checkout PR') {
|
||||
if (params.ghprbPullId != null) {
|
||||
|
@ -13,11 +13,6 @@ def ssh(cmd) {
|
||||
sh "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${CICO_NODE} '${cmd}'"
|
||||
}
|
||||
|
||||
environment {
|
||||
// "github-api-token" is a secret text credential configured in Jenkins
|
||||
GITHUB_API_TOKEN = credentials("github-api-token")
|
||||
}
|
||||
|
||||
node('cico-workspace') {
|
||||
stage('checkout ci repository') {
|
||||
git url: "${ci_git_repo}",
|
||||
@ -25,6 +20,8 @@ node('cico-workspace') {
|
||||
changelog: false
|
||||
}
|
||||
|
||||
// "github-api-token" is a secret text credential configured in Jenkins
|
||||
withCredentials([string(credentialsId: 'github-api-token', variable: 'GITHUB_API_TOKEN')]) {
|
||||
stage('skip ci/skip/e2e label') {
|
||||
if (params.ghprbPullId == null) {
|
||||
skip_e2e = 1
|
||||
@ -47,6 +44,7 @@ node('cico-workspace') {
|
||||
returnStdout: true).trim()
|
||||
echo "detected Kubernetes patch release: ${k8s_release}"
|
||||
}
|
||||
}
|
||||
|
||||
stage('checkout PR') {
|
||||
if (params.ghprbPullId != null) {
|
||||
|
@ -14,17 +14,14 @@ def ssh(cmd) {
|
||||
}
|
||||
|
||||
node('cico-workspace') {
|
||||
environment {
|
||||
// "github-api-token" is a secret text credential configured in Jenkins
|
||||
GITHUB_API_TOKEN = credentials("github-api-token")
|
||||
}
|
||||
|
||||
stage('checkout ci repository') {
|
||||
git url: "${ci_git_repo}",
|
||||
branch: "${ci_git_branch}",
|
||||
changelog: false
|
||||
}
|
||||
|
||||
// "github-api-token" is a secret text credential configured in Jenkins
|
||||
withCredentials([string(credentialsId: 'github-api-token', variable: 'GITHUB_API_TOKEN')]) {
|
||||
stage('skip ci/skip/e2e label') {
|
||||
if (params.ghprbPullId == null) {
|
||||
skip_e2e = 1
|
||||
@ -47,6 +44,7 @@ node('cico-workspace') {
|
||||
returnStdout: true).trim()
|
||||
echo "detected Kubernetes patch release: ${k8s_release}"
|
||||
}
|
||||
}
|
||||
|
||||
stage('checkout PR') {
|
||||
if (params.ghprbPullId != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user