Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upload artifacts with the Windows Runner

We use a official Windows runner from Gitlab-ci. We want to upload artifacts.

We use the 'artifact' keyword in our yaml file to define the artefacts that need to be uploaded. When we commit this is the message we are getting:

gitlab-ci-multi-runner 0.7.2 (998cf5d)
WARNING: artifacts is not supported by selected executor and shell
Using Shell executor...

So is this because it is using a Windows machine? What is the deal here?

like image 240
E. van der Spoel Avatar asked Sep 26 '22 01:09

E. van der Spoel


1 Answers

Uploading artifacts from the windows shells cmd and powershell are currently not supported. After a while of digging the source I found that according to gitlab-ci-multi-runner\shells\bash.go bash does support it.

The working solution for me is:

  1. install Bash (already included with Git-SCM)
  2. add the bash directory (C:\Program Files (x86)\Git\bin) to your PATH
  3. make sure bash starts if you type bash in the cmd
  4. find your config.toml and modify/add:

    executor = "shell"  
    shell = "bash" 
    
  5. restart your git-runner service

  6. make sure your build scripts are in bash-syntax
    (for example run windows commands from bash with cmd.exe /c "dir")
like image 187
kernrot Avatar answered Dec 16 '22 11:12

kernrot