Windows GitLab CI Runner using Bash

I am trying to use bash as a Windows shell for the GitLab CI Runner.

concurrent = 1
check_interval = 0

[[runners]]
  name = "DESKTOP-RQTQ13S"
  url = "https://example.org/ci"
  token = "fooooooooooooooooooobaaaaaaaar"
  executor = "shell"
  shell = "bash"
  [runners.cache]

Unfortunately, I cannot find the ability to specify the actual shell program that CI Runner should use. By default, it just launches bashwhich it cannot find. I don’t know why, because when I open the Windows command prompt and enter bash, it works.

Running with gitlab-ci-multi-runner 1.9.4 (8ce22bd)
Using Shell executor...
ERROR: Build failed (system failure): Failed to start process: exec: "bash": executable file not found in %PATH%

I tried adding a file bash.cmdto the user directory containing

@"C:\Program Files\Git\usr\bin\bash.exe" -l

This gives me this weird error:

Running with gitlab-ci-multi-runner 1.9.4 (8ce22bd)
Using Shell executor...
Running on DESKTOP-RQTQ13S...
/usr/bin/bash: line 43: /c/Users/niklas/C:/Users/niklas/builds/aeb38de4/0/niklas/ci-test.tmp/GIT_SSL_CAINFO: No such file or directory
ERROR: Build failed: exit status 1

Is there any way to configure this correctly?

+10
source share
2 answers

, , , .

  1. gitlab-runner bash
  2. gitlab-runner Unix Windows.

, , bash.cmd. , , , bash , , (, "C:\Program Files\Git\usr \" bin ") PATH . , , gitlab-runner , PATH. , , PATH , , bin (.. , ). , , , . bash , , .

, bash.cmd, . , bash Windows. Gitlab-runner, , , , , Windows , ($PWD). , gitlab ( 9.0 !!) , , . , , , . , . config.toml. Unix, . Windows config.toml , gitlab-runner.exe ( gitlab-multi-runner-amd64.exe ..). . [[runners]] , .

builds_dir="/c/gitlab-runner/builds/"
cache_dir="/c/gitlab-runner/cache/"

, , "bash-" , , gitlab-runner .. , cygwin, , /cygdrive/c/... /c/... ( msys-git MSYS2 ..).

config.toml:

[[runners]]
  name = "windows"
  url = "https://your.server.name"
  token = "YOUR_SECRET_TOKEN"
  executor = "shell"
  shell = "bash"
  builds_dir="/c/gitlab-runner/builds/"
  cache_dir="/c/gitlab-runner/cache/"
+9

, gitlab-ci Windows Linux ( , bash Windows)? , Gitlab.

Powershell .

            Executor = 'shell'
            Shell = 'powershell'

Bash , .gitlab-ci.yml.

, .gitlab-ci.yml( script), , Windows .

0

Source: https://habr.com/ru/post/1667217/


All Articles