使用Jenkins,Pipelines,Blue Ocean和Bitbucket
我有以下Jenkins文件
pipeline {
agent any
stages {
stage('Checkout') {
steps {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'f2c1e487-2df0-4ed9-ec25-56d8622615db', url: 'git@bitbucket.org:comapny/tooldata.git']]])
}
}
stage('Test') {
steps {
bat 'e:\\test.bat test'
}
}
}
}
会导致以下错误
Fetching upstream changes from git@bitbucket.org:company/tooldata.git
> C:\Program Files\Git\cmd\git.exe --version # timeout=10
> C:\Program Files\Git\cmd\git.exe fetch --tags --progress git@bitbucket.org:company/tooldata.git +refs/heads/*:refs/remotes/origin/*
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from git@bitbucket.org:company/tooldata.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:825)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1092)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1123)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
at hudson.security.ACL.impersonate(ACL.java:273)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: hudson.plugins.git.GitException: Command "C:\Program Files\Git\cmd\git.exe fetch --tags --progress git@bitbucket.org:company/tooldata.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: git@bitbucket.org: Permission denied (publickey).
fatal: Could not read from remote repository.
我所提到的凭证似乎已经被詹克斯接受,所以现在我不知所措。