1

here is my gitlab-ci.yml file:

image: python:3.6

before_script:
  - python --version
  - pip install -r requirements.txt

stages:
  - test

test:
  stage: test
  script:
    - chmod +x ./scripts/lint.sh
    - ./scripts/lint.sh
    - chmod +x ./scripts/tests.sh
    - ./scripts/tests.sh

Note that on my local machine, the job is running without any problem and it is using python 3.6.13

Running the job test online, I got this error: It does not make any sense!

below is the config of the runner which can run untagged job and the error message.

enter image description here

enter image description here

1 Answer 1

2

The screenshot you've showed, the job is run using the shell-executor, and so is using the Python version on whichever machine you have installed the gitlab-runner on.

It looks like you want to use the docker-executor for using image: python:3.6, and so I would reinstall the runner to use the docker executor.

Alternatively, you can update your machine which is using the shell executor, to have Python 3 instead.

Another issue could be that you have not tagged your runners, and are using the wrong gitlab-runner. Make sure you've tagged your shell / docker runners, ie with shell-runner or docker-runner, and then in the test job, add:

tags:
  - docker-runner
Sign up to request clarification or add additional context in comments.

4 Comments

the same file was working last week! It is all about gitlab-runner
afraid I can't really comment more without more info @BetterEnglish. Maybe you installed a new runner? either way, if you have more than 1 runner, you should use tags!
Thanks but I have only 1 runner for 1 project.
Ok, either update your runner to use the docker-executor, or upgrade Python on the shell-runner.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.