node.js - GitLab CI: configure yaml file on NodeJS -


i have problem test scss-lint in project on nodejs.

enter image description here

when tests reach scss-lint, gives error.

how make sure tests not fall successful result of test itself?

my gitlab-ci.yml

image: node:wheezy  cache:   paths:     - node_modules/  stages:   - build   - test  gem_lint:   image: ruby:latest   stage: build   script:     - gem install scss_lint   artifacts:     paths:      - node_modules/   only:     - dev   except:     - master  install_dependencies:   stage: build   script:     - npm install   artifacts:     paths:       - node_modules/   only:     - dev   except:     - master  scss-lint:   stage: test   script:     - npm run lint:scss-lint   artifacts:     paths:       - node_modules/   only:     - dev   except:     - master 

you doing wrong.

each job define (gem_lint, install_dependencies, , scss-lint) run own context. problem here during last step, doesn't find scss-lint gem installed because switched context.

you should execute scripts @ same time in same context :

  script:     - gem install scss_lint     - npm install     - npm run lint:scss-lint 

of course need have docker image has both npm , gem installed maybe can find 1 on docker hub), or can choose 1 (for example : ruby:latest) , add first script 1 install npm :

    - curl -sl https://deb.nodesource.com/setup_6.x | bash -  

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -