I'm using the GitLab Runner using a shell executor on windows. I'm trying to use bash as the shell for the runner. If I use powershell my script will run but none of the output of the bash scripts is captured. My goal is to use the bash shell so that I can capture the output of my bash scripts and return a fail or success of a job accurately. Changing from powershell to bash as my shell in my config was my first thought.
This is the config.toml of my runner:
concurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "Window's VM"
url = <gitlab url>
token = <token>
executor = "shell"
shell = "bash"
builds_dir="/cygdrive/c/Gitlab-Runner/builds/"
cache_dir="/cygdrive/c/Gitlab-Runner/cache/"
[runners.custom_build_dir]
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
[runners.cache.azure]
I included the builds_dir
and cache_dir
arguments per this questions answer.
This is the output of my runner when I run the job.
Running with gitlab-runner 15.1.0 (76984217)
on Window's VM that runs SWEET <token>
Resolving secrets
00:00
Preparing the "shell" executor
00:00
Using Shell executor...
Preparing environment
00:01
Running on runner0...
Getting source from Git repository
00:00
Fetching changes with git depth set to 50...
error: could not lock config file /cygdrive/c/Gitlab-Runner/builds/<token>/0/repo.tmp/git-template/config: No such file or directory
error: could not lock config file /cygdrive/c/Gitlab-Runner/builds/QxyNx21o/0/repo.tmp/git-template/config: Invalid argument
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit status 1
When I check that file, it exists so I'm unsure of why the runner thinks it doesn't exist.
This is my .gitlab-ci.yml file:
stages:
- build
run-script:
stage: build
tags:
- sweet
script:
- ./script0.sh -s .\another_dir\argument_file
- ./script1.sh