我正在使用Jenkins pipeline(声明性语法),我想将提交推送到我的远程代码库。
是否有一种方法可以使用git插件来实现这一目标? 下面是我目前尝试的方法:
withCredentials([usernamePassword(credentialsId: "${GIT_CREDENTIAL_ID}", passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
sh "git add ${BRANCH_RENAME}.bundle"
sh "echo ${GIT_USERNAME}|||||||${GIT_PASSWORD}"
sh "git tag -a backup -m 'Backup branch ${BRANCH} from vega-salesforce to vega-salesforce-backup' "
sh('git push https://${GIT_USERNAME}:${GIT_PASSWORD}@${GIT_URL_WITHOUT_HTTPS} --tags')
}
但它不起作用。我收到以下错误:
fatal: unable to access 'https://****:****@myrepositoryurl/mygitgroup/salesforce-backup/': Could not resolve host: ****:clear_password_here; Name or service not known
请问有人能帮忙吗? 我认为问题可能是由于密码中存在特殊字符,但不确定。