Gitlab CI执行错误但管道成功

时间:2019-05-16 06:11:07

标签: gitlab gitlab-ci gitlab-ci-runner

我有一个简单的项目.gitlab-ci.yaml

variables:
  GIT_STRATEGY: clone

stages:
 - build

build-and-run-tests:
  stage: build
  tags:
    - windows
  script:
    - call npm install
    - call npm run build-client-in-target
    - call npm run run-tests-on-target 

当我启动构建管道时,它在执行build-client-in-target时失败,但是管道以成功状态继续

enter image description here

1 个答案:

答案 0 :(得分:0)

您应将所有预处理移至before_script标签 并删除通话命令

https://docs.gitlab.com/ee/ci/yaml/#before_script-and-after_script

variables:
  GIT_STRATEGY: clone

stages:
 - build

build-and-run-tests:
  stage: build
  tags:
    - windows
  before_script:
    - npm install
    - npm run build-client-in-target
  script:
    - npm run run-tests-on-targe