Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why gitlab-runner run execution as ruby docker when i set executor as shell?

gitlab-ci

stages:
  - deploy
deploy:
  stage: deploy
  script:
    - npm install
    - npm run build
    - cp -R build/* /var/www/html

pipeline:

 Preparing the "docker+machine" executor
00:28
Using Docker executor with image ruby:2.5 ...

Why docker ruby? Why not shell executor?

my config.toml

concurrent = 1
check_interval = 0

[session_server]
session_timeout = 1800

[[runners]]

    name = "test"
    url = "https://gitlab.com/"
    token = "123321123"
    executor = "shell"
    shell = "bash"
like image 583
Александр Воробьёв Avatar asked Jun 19 '26 21:06

Александр Воробьёв


1 Answers

You most likely have shared runners enabled on the repository, and it just so happens that when the job is submitted, that the job picks up the shared runner first, rather than your custom shell runner.

So an option available is to disable shared runners for your project:

  • Go to Project's Settings > CI/CD
  • In the Shared runners section, disable Enabled Shared runners for this project.

A better solution would be to enable tags on the Runners.

When registering the runner, at step 5, you can provide tags associated with the runner. You can also change the tags in the GitLab UI if you have sufficient permissions in:

gitlab.com -> group -> settings -> CI/CD -> runner settings

Note, the tags are not changeable in the config.toml file.

You can now, for example, tag your runner with shell-internal, and then to run jobs only on this runner, add tags: - shell-internal in your gitlab-ci.yml file:

build:
  script:
    - echo "running on shell-internal"
  tags:
    - shell-internal

This link should explain how GitLab runners work: https://docs.gitlab.com/ee/ci/runners/

like image 192
Rekovni Avatar answered Jun 23 '26 20:06

Rekovni



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!