1
votes

In Azure DevOps, recently SSH task is failing when I ran SSH task as a inline script. Earlier I was running this command in SSH task as inline script and deployment was successful before.

cd /www/xxx/xxx/xxx/platform
source setantenv_devops.sh
ant updatesystem -Dtenant=xxx -DconfigFile=/www/xxx/xxx/xxx/platform/xxx_update_config.json 

Now since this issue of not able to run azure devops ssh task as inline script i want to run the SSH task as commands option in azure DevOps but it's failing with error

##[error]bash: setantenv_devops.sh: No such file or directory

But the file setantenv_devops.sh exists in that particular location.

1
Can you list files before calling source setantenv_devops.sh?Krzysztof Madej
after the first step i was able to do 'ls' and list all files in thereSar
Ok. Can you show use what files you have there?Krzysztof Madej
thank you i found that what i was missing and changed multiple lines to single commandSar

1 Answers

1
votes

Azure DevOps SSH task in commands option executes the command cd /www/xxx/xxx/xxx/platform and then goes back to user working directory. so I tried with below option and multiple lines of command as a single command and it worked. Thanks @Krzysztof Madej

cd /www/xxx/xxx/xxx/platform && source setantenv_devops.sh && ant updatesystem -Dtenant=xxx -DconfigFile=/www/xxx/xxx/xxx/platform/xxx_update_config.json