Git SCM中的jenkins管道脚本->;错误:获取远程回购时出错';原产地';
我在用詹金斯当被告 我创建了一个简单的作业,其中包含以下git详细信息: 我确实从jenkins ui添加了凭据:-Git SCM中的jenkins管道脚本->;错误:获取远程回购时出错';原产地';,git,jenkins,jenkins-pipeline,Git,Jenkins,Jenkins Pipeline,我在用詹金斯当被告 我创建了一个简单的作业,其中包含以下git详细信息: 我确实从jenkins ui添加了凭据:- url: https://myTeam:appPassword@bitbucket.org/MinoxTeam/bizcuit.git credentials : myTeam /appPassword 这是一项简单的工作 我想为jenkins创建一个管道并使用jenkins文件 我对管道使用相同的git凭据 但错误:无法获取原始主机。 错误是: stderr: remote:
url: https://myTeam:appPassword@bitbucket.org/MinoxTeam/bizcuit.git
credentials : myTeam /appPassword
这是一项简单的工作
我想为jenkins创建一个管道并使用jenkins文件
我对管道使用相同的git凭据
但错误:无法获取原始主机。
错误是:
stderr: remote: Invalid username or password
fatal: Authentication failed for 'https://team:appPassword.git/'
hudson.plugins.git.GitException: Failed to fetch from https://myTeam.myRepository.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:888)
我的詹金斯档案
pipeline {
agent any
options {
skipDefaultCheckout()
}
stages {
stage(checkout) {
steps {
ws('/var/jenkins_home/workspace/pipelineDemo@script') {
git branch: 'feature/jenkinsTest',
credentialsId: 'appPassword',
url: 'https://myTeam:appPassword@bitbucket.org/myTeam/myRepository.git'
sh "ls -lat"
}
}
}
credentialsId:'appPassword'
必须是凭据的ID,而不是密码本身。看起来它不喜欢url中的团队/密码-我建议您将其取出。此外,我认为credentialsId应该具有Jenkins中配置的凭据的id,而不是密码。@Joe我已经为签出步骤生成了一个管道语法,它在Jenkins gui中工作,当我构建管道脚本时,它可以工作,但问题是来自SCM的管道脚本不工作(错误:凭据不正确)