gitlabgitlab-cipipelinelftp

Deploy a proyect with Gitlab cd/ci and lftp in a server with cpanels


I has been reainding some question and articles before make this question:

My problem is that I use the pipeline variables I can not login.

$ lftp -e "set ssl:verify-certificate false; mirror --reverse --verbose=3 --delete ./ ./ --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/; quit" -u $FTP_USER,$FTP_PASS $FTP_HOST
mirror: Login failed: 530 Login authentication failed
Cleaning up project directory and file based variables

But if I add the varaible value in the yml it works. Cpanels fpt user is build in this way: user@domian I don't know if this can be the problem when it's in a variable.

$ lftp -e "set ssl:verify-certificate false; mirror --reverse --verbose=3 --delete ./ ./ --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/; quit" -u user@domian,password domain

Solution

  • In such cases where you are able to successfully run the command directly but it's not working when using variables. Checking a few cases usually helps.

    1. Echo the variable and check the values and order
    2. Check if the variable is protected. Protected variables are only accessible in protected branches.