I've been trying to deploy my destination folder via Bitbucket pipelines and lftp for quite a while now. I've tried various variations of the Linux commands and have gone through a couple of 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 without any luck. How can I fix it?
I don't have any 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 at how to send standard input to a program with Bitbucket. (For information on standard input: it is referred to as "input" in following tutorial which explains how shell works: 1.3. Executing commands)