During our jenkins build we are attempting to push to git. Our password has recently changed, and now includes an @ symbol which gives the following error:
The advice seems to be to encode the password, but I am unable to figure out how to do this within our jenkins pipeline. How do I do this? (I have also tried using the replace method to swap the @ symbol for %40, but that didn't work.)
def GIT_PASSWORD_R = GIT_PASSWORD.replace('@', '%40')
Escape @ character in git proxy password
def GIT_PASSWORD_R = GIT_PASSWORD.toURL()
git push -f https://${GIT_USERNAME}:${GIT_PASSWORD_R}@github.company.com/Product/subProd.git ${VERSION}-SNAPSHOT