【发布时间】:2021-05-06 15:34:36
【问题描述】:
我们有一个要求,在 Jenkins 管道中,我们必须提升 NodeJS 包的 npm 版本并执行 git tag git push。
为此,我们所做的是拥有一个 Python 脚本,该脚本将在升级版本之前执行一些任务。 因此我们在 Jenkinsfile 中这样做了
withCredentials([usernamePassword(credentialsId: 'username', passwordVariable: 'adminPass', usernameVariable: 'adminUser')]) {
sh "echo https://$adminUser:$adminPass@github**** > ~/.git-credentials"
sh "git config --local credential.helper store --file=~/.git-credentials"
但是每次我们从 python 脚本中执行 push 命令时,都会出现这个错误
could not read Username for 'https://github.****.org': No such device or address
问题是简单的错误,但是当我们尝试用谷歌搜索该问题时,我们得到了各种各样的解决方案,但都不起作用..
【问题讨论】:
标签: jenkins