Override script key

I have a multi-stage build set-up for an open-source academic project,

with the corresponding .travis.yml: https://github.com/humlab/video_reuse_detector/blob/master/.travis.yml

Wherein if I have the following set-up,

  - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -y ffmpeg npm; fi

install:
  - 'pip install pipenv'
  - 'pipenv install --dev'
  - 'npm i --prefix frontend'

then my Tests stage (default name) can run without issue, but then for my named stage “App Tests” the build will fail with the following error,

$ npm i --prefix frontend
Please override the script: key in your .travis.yml to run tests.

Here is a sample instance of this happening: https://travis-ci.com/humlab/video_reuse_detector/builds/151719834 (https://travis-ci.com/humlab/video_reuse_detector/jobs/293839605)

I need npm to be able to lint-check the JS-part of what is predominantly a Python code-base. How do I have these things co-exist?

The problem is here:

- stage: "App Tests" is an item by itself (in an array of jobs.include), defining a new stage and a default Python job. From what you are describing, I believe what you want is to combine this line with the following job with the script key, so that you have:

- stage: "App Tests"
  script: docker-compose …

See the first example in this section of the documentation.

1 Like

That worked beautifully. Thank you!