我正在使用GitLab的“CI Multi-Runner”,这是我在Windows 2012 R2实例上安装的。 构build开始正确,并开始运行,但构build被标记为完成之前,甚至运行我的整个脚本。
.gitlab-ci.yml
build_web: script: - cd Web - npm install - jspm install - gulp build
在推送时,pipe道通过npm install运行,然后输出“Build succeeded”并成功结束构build(跳过了以下两个命令)。
我一直在使用带有NodeJs / NPM命令的Windows在GitLab CI上遇到这些早期的退出问题。 我使用PowerShell来解决这个问题,把这些命令换成直接调用NPM
更换:
- npm install
有:
- powershell -Command "Start-Process npm -ArgumentList install -Wait"
在我的情况下,我需要运行grunt以及导致相同的问题,所以类似的包装像
powershell -Command "Start-Process grunt -ArgumentList autobuild -Wait"
希望这对你有用
托比
更改npm install来call npm install 。 这是Windowsshell程序的工作原理,如果不使用call ,它将在相同的上下文中执行,然后在运行后退出。