ci: get the GitHub API Token before starting a node

It still seems that the environment is not set when the GitHub API is
called. Maybe things work better when the environment is set before
starting the cico-workspace node.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2020-10-19 10:45:02 +02:00 committed by mergify[bot]
parent debb54a1dd
commit a6ca8e31dc
2 changed files with 10 additions and 10 deletions

View File

@ -16,12 +16,12 @@ def ssh(cmd) {
sh "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${CICO_NODE} \"${cmd}\""
}
node('cico-workspace') {
environment {
// "github-api-token" is a secret text credential configured in Jenkins
GITHUB_API_TOKEN = credentials("github-api-token")
}
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}",
branch: "${ci_git_branch}",

View File

@ -13,12 +13,12 @@ def ssh(cmd) {
sh "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${CICO_NODE} '${cmd}'"
}
node('cico-workspace') {
environment {
// "github-api-token" is a secret text credential configured in Jenkins
GITHUB_API_TOKEN = credentials("github-api-token")
}
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}",
branch: "${ci_git_branch}",