1

I’m new to the GitLab CI/CD. I’m having a problem with the continous integration.
This is my config.toml

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "runner-pc"
  url = "https://gitlab.com/"
  token = "xxxxxxxxxxxxxxx"
  executor = "docker"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
  [runners.docker]
    tls_verify = false
    image = "docker:19.03.1"
    privileged = false
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
    shm_size = 0

Here is my simple .gitlab-ci.yml

stages:
  - test

job1:
  stage: test
  script:
    - docker --version
    - git --version
  tags:
    - ldc
  only:
    - develop

What I was expecting was to see in the pipeline console is: the version of git
The current result is:
/bin/sh: eval: line 90: git: not found
I just want to use some commands line of Git like git diff, git show, ...
Could you give any hint to find this out?
Thanks for your time!

the moon
  • 29
  • 2
  • 9
  • Where are you running this? Does the instance of that environment contain git? – Mike Apr 05 '20 at 05:08
  • You mean that git is installed inside runner? – the moon Apr 05 '20 at 06:55
  • Where is your repository placed? [GitLab.com](https://gitlab.com) Or local installed GitLab. I asked that because GitLab.com uses image `ruby:latest` when nothing is specified (Like your case) and the image contains installed git. – Amir Dadkhah Apr 05 '20 at 07:53
  • I use [GitLab](http://gitlab.com) for project, not local. – the moon Apr 05 '20 at 09:55

1 Answers1

3

Since the default OS of pipeline is Debian, you can try installing Git using apt-get package manager:

stages:
  - test

job1:
  stage: test
  script:
    - apt-get update -qy && apt-get upgrade -qy    # This line used for updating OS repositories
    - apt-get install -y git                       # This command used for installing Git
    - docker --version
    - git --version
  tags:
    - ldc
  only:
    - develop
Amir Dadkhah
  • 1,074
  • 2
  • 11
  • 17