I've been trying to deploy my dist folder via bitbucket pipelines + lftp for quite a while now. I've tried various variations of the linux commands and gone through a couple dozen articles on the issue yet I still can't get the thing to work.
So far my pipeline commands look like this:
- apt-get update
- apt-get install lftp
- lftp set ssl:verify-certificate no
- lftp $FTP_HOST
- user $FTP_USER
- $FTP_PASSWORD
- ls
- quit
But for set I'm getting 'lftp: set: Name or service not known'
-- when I delete the step it gets to user and I'm getting bash: user: command not found
if I add lftp in front of it I'm getting lftp: user: Name or service not known
I think in total I've tried over 30+ times to get these right with no luck.
I have no complete solution as I don't know bitbucket, but I see clearly one mistake:
You cannot change lftp settings in subsequent command calls. That's what you are actually doing:
lftp
with wrong command line arguments set ssl:verify-certificate no
. lftp
quits with error message set: Name or service not known
. Even if you would have gotten the setting inside lftp in step 1 it would be cleared now because of the quit.lftp
with (probably) right command line argument '$FTP_HOST'.So please look how to send stdin to a program with bitbucket. (For information on stdin: it is refered to as "input" in following tutorial which explains how shell works: http://tldp.org/LDP/Bash-Beginners-Guide/html/Bash-Beginners-Guide.html#sect_01_03 )