GitLab runner runs first two commands and says “build succeeded”

continuous integrationgitlabwindows-server-2012-r2

I'm using GitLab's "CI Multi-Runner", which I have installed on Windows 2012 R2 instance. Builds start correctly and begin to run, but the build is marked as complete before it even runs my entire script.

.gitlab-ci.yml

build_web:
  script:
    - cd Web
    - npm install
    - jspm install
    - gulp build

Upon pushing, the pipeline runs through npm install and then outputs "Build succeeded" and ends the build successfully (having skipped the following two commands).

Best Answer

I've been having these early exit issues on GitLab CI with Windows with NodeJs / NPM commands. I solved it using PowerShell to wrap the commands in place of directly calling NPM

replacing:

- npm install

with:

- powershell -Command "Start-Process npm -ArgumentList install -Wait"

In my case I needed to run grunt as well which caused the same issue so similarly wrapped like

powershell -Command "Start-Process grunt -ArgumentList autobuild -Wait"

Hope that works for you
Toby