嗨,我想把Jenkins管道脚本。我在Jenkins凭据中注册了git id/-。我已成功git克隆。这是git克隆脚本git branch: "develop", credentialsId: "mygitid", url: "mygiturl"现在我想提交和推动..但我不知道如何做到这一点..有人有主意吗?
git branch: "develop", credentialsId: "mygitid", url: "mygiturl"
luaexgnf1#
可以使用Credentials Binding pugin执行push from a Jenkins pipeline
stage('git push') { steps { withCredentials([ gitUsernamePassword(credentialsId: 'mygitid', gitToolName: 'Default') ]) { sh ''' # modify some files git add . git commit -m "register work" git push ''' } } }
这假设您仍然在默认的克隆分支上(通常为' main ')
main
1条答案
按热度按时间luaexgnf1#
可以使用Credentials Binding pugin执行push from a Jenkins pipeline
这假设您仍然在默认的克隆分支上(通常为'
main
')