I want to run a python script for ssh deployment:
image: atlassian/default-image:latest
pipelines:
default:
- step:
script:
- apt-get install sshpass
- sshpass -p $SSH_PASS ssh -o StrictHostKeyChecking=no -p $SSH_PORT $SSH_USER@$SSH_IP "echo $SSH_PASS | sudo -S python3 /var/www/deploy.py -t api -gu $GITUSER -gp $GITPASSWORD"
When I run it through a linux csh client, or windows - everything works as it should, but the pipeline always shows an error:
<span><br></span><span>Warning: Permanently added '[xxx.xxx.xxx.xxx]:xxx' (ECDSA) to the list of known hosts.<br></span><span>[sudo] password for kshnkvn: usage: <a href="http://deploy.py/" target="_blank" rel="noopener nofollow noreferrer">deploy.py</a> [-h] [--target TARGET]<br></span><span><a href="http://deploy.py/" target="_blank" rel="noopener nofollow noreferrer">deploy.py</a>: error: argument -h/--help: ignored explicit argument 'u'</span><span>+ sshpass -p $SSH_PASS ssh -o StrictHostKeyChecking=no -p $SSH_PORT $SSH_USER@$SSH_IP "echo $SSH_PASS | sudo -S python3 /var/www/deploy.py -t api -gu $GITUSER -gp $GITPASSWORD</span>