Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Why isn't the python script running with arguments?

Ivan Yakushenko December 10, 2020

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:

+ 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
Warning: Permanently added '[xxx.xxx.xxx.xxx]:xxx' (ECDSA) to the list of known hosts.
[sudo] password for kshnkvn: usage: deploy.py [-h] [--target TARGET]
deploy.py: error: argument -h/--help: ignored explicit argument 'u'

1 answer

0 votes
Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 23, 2021

@Ivan Yakushenko  did you figure out?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events