When using a shell-runner it possible to pass if statements on a remote server?
Here is such a test gitlab-ci.yml:
world_branch: variables: dir: "/home/TATATA" environment: staging script: - ssh-keyscan -H 192.168.0.12 >> ~/.ssh/known_hosts - ssh root@192.168.0.12 " 'if [[ -d "$dir" ]]; then rm -r $dir && mkdir $dir fi' " - rsync -avz --delete-after --exclude=".git" --exclude=".gitlab-ci.yml" . root@192.168.0.12:/home/TATATA only: - world After starting the task, here is the error:
bash: if [[ -d /home/TATATA ]] rm -r /home/TATATA && mkdir /home/TATATA fi: No such file or directory