首页 > Windows开发 > 详细

gitlab-runner在windows中.gitlab-ci.yml文件的配置方法

时间:2020-03-18 20:32:54      阅读:340      评论:0      收藏:0      [点我收藏+]

gitlab-runner的配置

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "yourname"
  url = "https://git.yourname.com/"
  token = "yourtoken"
  executor = "shell"
  shell = "powershell"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]


.gitlab-ci.yml文件

Job:
 stage: deploy
 only: ["yourname"]
 tags: ["yourtag"]
 script:
   - chcp 65001
   - echo "spend my 10 hours"
   - "C:"
   -  cd C:\www   - powershell
   - git checkout . 
   - git pull


说明:
代码的细节不重要。重要的是思路。
gitlab-runner运行在linux下时,运行良好,但在windows下却出问题。
最严重的问题是.gitlab-ci.yml配置内的git无法运行。但在windows服务器内直接测试是可以运行的。
后来发现,配置的script并没有运行起来powershell,而是在cmd下运行的。但是在windows服务器内的cmd下git是可以运行的。
为什么windows是这样的呢?


gitlab-runner在windows中.gitlab-ci.yml文件的配置方法

原文:https://www.cnblogs.com/codeaaa/p/12519800.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!