有没有办法推回 Jenkins 管道使用与检出代码相同的过程(使用GIT_ASKPASS)检出的存储库?
我目前有一个解决方案,可以通过获取这样的凭据来实现这一点:
withCredentials([usernamePassword(credentialsId: 'github', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) {
sh('git push https://$GIT_USER:$GIT_PASS@github.com/orgname/private-repo.git master')
}
Run Code Online (Sandbox Code Playgroud)
我不是 Groovy 开发人员,但在 git-client-plugin 中找到了一个我想使用的方法。有没有办法直接在下面的方法中使用Jenkinsfile
launchCommandWithCredentials
| 归档时间: |
|
| 查看次数: |
1432 次 |
| 最近记录: |