8

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 npm test and npm run build should be executed.

The .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

Unfortunatly only the npm install gets executed twice. And this not silent.
npm test and npm run build get never called.

Can anyone tell me, what I do wrong?

1
  • Regarding npm being too verbose, I think the npm maintainers are working on that (see github.com/npm/npm/issues/10732 and github.com/npm/npm/pull/15914). Using the --silent option makes it less verbose than without. As for your jobs not running properly, I don't see any obvious mistakes, my npm pipeline looks roughly similar and it works Commented Apr 15, 2017 at 16:11

1 Answer 1

3

I had similar problem:

setup:                                                                                          
    stage: setup
    script:
        - npm install
        - echo "done"

But echo "done" was never executed. Solution was to add call before npm:

setup:                                                                                          
    stage: setup
    script:
        - call npm install
        - echo "done"

Here are details. Apparently it has something to do how windows execute batch in batch.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.