Gitlab CI不执行npm脚本 [英] Gitlab CI does not execute npm scripts
问题描述
我尝试使CI脚本在gitlab运行程序上运行。
我想要的很简单:
首先应执行npm install命令以获取所有必需的npm软件包。
之后,进行 npm测试
和 npm运行构建
应该执行。
.gitblab-ci.yml
脚本如下所示:
before_script:
-cd my / folder /
-npm install --silent
阶段:
-测试
-建立
运行测试:
脚本:
-npm测试
阶段:测试
生成:
脚本:
-npm运行生成
阶段:生成
不幸的是,只有 有人可以告诉我,我做错了什么吗? 类似的问题: 但是 这里是详细信息。显然,它与Windows如何批量执行批处理有关。 I try to make a CI script running on a gitlab runner. What I want is simple: First the npm install command should be executed to fetch all the required npm packages. After that the The Unfortunatly only the Can anyone tell me, what I do wrong? I had similar problem: But Here are details. Apparently it has something to do how windows execute batch in batch. 这篇关于Gitlab CI不执行npm脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! npm安装
被执行了两次。 b b bb b b b b b b
设置:
阶段:安装
脚本:
-npm install
-echo done
echo done
从未执行。解决方法是在 npm
之前添加呼叫
:
设置:
阶段:安装
脚本:
-调用npm install
-echo done
npm test
and npm run build
should be executed..gitblab-ci.yml
script looks as follow:before_script:
- cd my/folder/
- npm install --silent
stages:
- test
- build
run_tests:
script:
- npm test
stage: test
build:
script:
- npm run build
stage: build
npm install
gets executed twice. And this not silent.
npm test
and npm run build
get never called.setup:
stage: setup
script:
- npm install
- echo "done"
echo "done"
was never executed. Solution was to add call
before npm
:setup:
stage: setup
script:
- call npm install
- echo "done"