0

For a old codebase, we're trying to go from just uploading changes through FTP to using Gitlab CI/CD. However, none of us have extensive Gitlab experience, and I've been trying to set the deployment up by following this guide:

https://savjee.be/2019/04/gitlab-ci-deploy-to-ftp-with-lftp/

I'm running a gitlab-runner on my own mac right now, however, it seems like the docker image in my yml file is not loaded correctly. When using the yml from the article:

image: ubuntu:18.04 before_script: - apt-get update -qy - apt-get install -y lftp build: script: # Sync to FTP - lftp -e "open ftp.mywebhost.com; user $FTP_USERNAME $FTP_PASSWORD; mirror -X .* -X .*/ --reverse --verbose --delete local-folder/ destination-folder/; bye" 

It tells me apt-get: command not found. I've tried with apk-get as well, but no differences. I've tried to find a different docker image that has lftp installed ahead of time, but then I just get a lftp: command not found:

image: minidocks/lftp:4 before_script: # - apt-get update -qy #- apt-get install -y lftp build: script: - lftp -e "open ftp.mywebhost.com; user $FTP_USERNAME $FTP_PASSWORD; mirror -X .* -X .*/ --reverse --verbose --delete local-folder/ destination-folder/; bye" - echo 'test this' 

If I comment out the lftp/apt-get bits, I do get to the echo command, however (and it does work).

I can't seem to find any reason for this when searching online. Apologies if this is a duplicate question or I've just been looking in the wrong places.

5
  • 1
    Which executor did you choose when you installed the runner on your machine ? Commented Jan 7, 2022 at 0:52
  • I think I picked the shell executor. I was under the impression I had to pick that one since I was running it from my command line, but I'm assuming from the question that's not how it works? Commented Jan 7, 2022 at 13:54
  • 1
    docs.gitlab.com/runner/executors/#compatibility-chart => shell executor does not handle the image tag. The executor type you actually want is docker. Commented Jan 7, 2022 at 13:56
  • Thanks for the help, time to go use that executor then. Commented Jan 10, 2022 at 8:12
  • @Zeitounator that was indeed the problem. If you could post a reply so I can mark it as answer? Commented Jan 10, 2022 at 10:07

1 Answer 1

4

From your question, it seems you are executing your tasks on a gitlab-runner using the shell executor.

The shell executor does not handle the image keyword as exposed in the runner compatibility matrix.

Moreover, since you want to deploy on docker containers, you need the docker executor anyway.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.