I have written a shell script to clone the project from multiple location which is sent as a file. I read the file and pass the each location in a loop and perform my operation.
LocationFile.txt
Project1=https://[email protected]/my/path/testProject1.git
Project2=https://[email protected]/my/path/testProject2.git
Project3=https://[email protected]/my/path/testProject3.git
Project4=https://[email protected]/my/path/testProject3.git
Password.txt
Project1=password1
Project2=password2
Project3=password3
Project4=password4
I have a password file encrypted and stored in server, which I can read as part of script and passing into my script When I run my script during clone step its prompting for a password, I tried to pass the password like below which is not working
##############
gitpassword=$password1 #retrieved from Password.txt
for xxx
do
...
...
git clone "${ProjectArrayList[1]}"
read $gitpassword
...
..
done
##############
I know I can do password less if I use ssh, which I don't want to do. Is there a way to achieve this with my exsiting approach