Having the following bitbucket-pipeline.yml:
pipelines:
default:
- step:
name: deploy to production
script:
- sftp -oPort=PPPP pi@XXX.XXX.XXX.XXX
- cd /home/username/webserver
- put -r nameOfTheBuildFolder build/ - exit
I can see that the sftp command is being executed, but the result is just logging:
"Connected to XXX.XXX.XXX.XXX"
But it's not opening a sftp prompt.
Is there a way to actually browse and do command on the sftp prompt? Or is there a command to connect to the sftp prompt?
I also made a ticket at stackoverflow: https://stackoverflow.com/questions/50529815/bitbucket-pipeline-sftp-connection-doesnt-open-host-sftp-prompt
Pipelines are meant to be non-interactive, so it won't give you a prompt. You'll need either to use SSH keys for authentication, or provide the relevant password as an environment variable.
@Jonas Coenen trust me I am in the same situation, I have tried way too many FTP solutions but with Bit bucket it seems mystery. I have received a solution just now from Atlassian team which is as follows, please try it and let me know if it worked. Although the support is quick, but the level of support/response is not satisfactory for me to recommend bitbucket pipelines to other customers.
Solution to set up hosts within Bitbucket:
For transferring the files using PSFTP, you will need to add the following commands before the call:
cd /home/ftp/users/jeff del jam-old.tar.gz ren jam.tar.gz jam-old.tar.gz put jam.tar.gz chmod a+r jam.tar.gzand then run the script.
Please refer to this document for more details:
https://the.earth.li/~sgtatham/putty/0.60/htmldoc/Chapter6.htmlThere are also more solutions offered in the following post:
https://stackoverflow.com/questions/7576700/how-to-pass-value-to-psftp-promptPlease take a look, make necessary adjustments to the YML file and create the recommended file with batch commands and give it a go.
I am using Solarwinds SFTP server and bit bucket pipelines, I'll try my luck. Let me know if the solution mentioned works for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.