-
Bug
-
Resolution: Not A Defect
-
Major
-
None
I have a freestyle project that can be built with parameters with one Password Parameter named git_pwd.
I have some code in an Execute Shell:
if [ -d "/netsec/ansible/${git_repo}" ]
then
echo "Directory /netsec/ansible/${git_repo} exists."
cd /netsec/ansible/${git_repo}
git pull https://${git_usr}:${git_pwd}@mhxgitsrv001sas.dsone.3ds.com/netsec/${git_repo}.git ${git_branch}
else
git config --global http.sslVerify false
git clone https://${git_usr}:${git_pwd}@mhxgitsrv001sas.dsone.3ds.com/netsec/${git_repo}.git
cd /netsec/ansible/${git_repo}
git pull https://${git_usr}:${git_pwd}@mhxgitsrv001sas.dsone.3ds.com/netsec/${git_repo}.git ${git_branch}
fi
git checkout ${git_branch}
So git_pwd is one of the parameters to fill before building the job.
But it doesn't work when the special character @ is present in git_pwd.
For example with git_pwd=abcd@efg , i have the following error in the logs :
fatal: unable to access '
https://admin:********@mhxgitsrv001sas.dsone.3ds.com/netsec/bo.git/
': Could not resolve host: efg@mhxgitsrv001sas.dsone.3ds.com; Unknown error Build step 'Execute shell' marked build as failure Finished: FAILURE
Because the character '@' in git_pwd is treated as a special character.