One of the 3 jobs in jobs.include has the stage attribute set to test, so it is combined with the 2 jobs at the top level, which also belong to the default test stage. Everything is working as documented.
So for the test stage it ran with 3 environments. What i want instead is to run the test stage only with 2 environments and build/deploy stage with only 1 environment (as it did). How should I change the travis file to achieve this behaviour?
Please read “Build Stages” document @native-api pointed to earlier in this topic. If you only want 2 jobs with differing set of environment variables, you need to drop the first job in jobs.include, and define script at the top level.
â‹®
env:
- DOCKER_MYSQL_TAG=5 DOCKER_MARIADB_TAG=10.4.12 DOCKER_POSTGRES_TAG=10 DOCKER_MSSQL_TAG=2017-CU17-ubuntu
- DOCKER_MYSQL_TAG=8 DOCKER_MARIADB_TAG=10.4.12 DOCKER_POSTGRES_TAG=11 DOCKER_MSSQL_TAG=2019-latest
install:
- npm install
script: npm run test
jobs:
include:
- stage: build
script: npm run build
- stage: deploy
script: npm run build
deploy:
edge: true
provider: npm
email: $NPM_EMAIL
api_key: $NPM_TOKEN
on:
branch: master
stages:
- test
- build
- deploy