简体   繁体   English

使用Windows Runner上载工件

[英]Upload artifacts with the Windows Runner

We use a official Windows runner from Gitlab-ci. 我们使用Gitlab-ci的官方Windows运行程序。 We want to upload artifacts. 我们想上传文物。

We use the 'artifact' keyword in our yaml file to define the artefacts that need to be uploaded. 我们在yaml文件中使用'artifact'关键字来定义需要上传的人工制品。 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? 这是因为它使用的是Windows机器吗? What is the deal here? 这是什么交易?

Uploading artifacts from the windows shells cmd and powershell are currently not supported. 目前不支持从Windows shell cmdpowershell上载工件。 After a while of digging the source I found that according to gitlab-ci-multi-runner\\shells\\bash.go bash does support it. 经过一段时间的挖掘,我发现根据gitlab-ci-multi-runner \\ shells \\ bash.go bash确实支持它。

The working solution for me is: 我的工作解决方案是:

  1. install Bash (already included with Git-SCM) 安装Bash(已包含在Git-SCM中)
  2. add the bash directory ( C:\\Program Files (x86)\\Git\\bin ) to your PATH 将bash目录( C:\\Program Files (x86)\\Git\\bin )添加到PATH
  3. make sure bash starts if you type bash in the cmd 如果在cmd键入bash ,请确保bash启动
  4. find your config.toml and modify/add: 找到你的config.toml并修改/添加:

     executor = "shell" shell = "bash" 
  5. restart your git-runner service 重启你的git-runner服务

  6. make sure your build scripts are in bash-syntax 确保您的构建脚本采用bash语法
    (for example run windows commands from bash with cmd.exe /c "dir" ) (例如,使用cmd.exe /c "dir"从bash运行windows命令)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM