I am using jenkins, so iam trying to execute below code in 'execute shell'
Below is the script:
ssh user@prod-server
cd /myfolder
pwd
if [ ! -d myproj ]; then
git clone http://prod-server/bbb/myproj.git
else
cd myproj
pwd
git pull
fi
In 'execute shell', iam trying as below but getting syntax errors while trying to build:
ssh prod-server 'cd /myfolder && pwd && if [ ! -d myproj ]; then git clone http://prod-server/bbb/myproj.git else cd myproj pwd git pull fi'
Here is the syntax error:
Syntax error: end of file unexpected (expecting "fi")
So, please tell me what to modify?