Use matrix assembly in Travis only when deploying

Is there a way to start the matrix assembly in travis during deployment? Currently, we use the same file .travis.ymlfor testing and deployment, and in both cases, the matrix assembly (and, therefore, two employees) is launched. I cannot find a way to run the assembly as a matrix in the case when we deploy, and not when we run the tests (or, perhaps, use only the matrix during the deployment process). The main reason I would like to do this is because I do not run additional assemblies when PRs are created, and I just need a test assembly to run.

I also could not find a simple way in which we could run a single assembly for testing npm install / npm, and then separate the two separate work / matrices for the โ€œdeploymentโ€ process, which would also solve the problem.

Here's the clipping of my current .travis.yml file:

language: node_js
node_js: 4.2.1
env:
  global:
    - APP_NAME=example
  matrix:
    - CF_DOMAIN=example1.net CF_TARGET=https://target1.com APP_NAME=${APP_NAME}-1
    - CF_DOMAIN=example2.net CF_TARGET=https://target2.com APP_NAME=${APP_NAME}-2

branches:
  only:
    - master
deploy:
- provider: script
  skip_cleanup: true
  script: node_modules/.bin/deploy.sh
  on:
    branch: master

For us, only building a matrix using a pushhook can work , but not on pr.

+4
source share
1 answer

A similar issue was posted on GitHub for Travis. It was suggested to use two separate .travis.yml files.

https://github.com/travis-ci/travis-ci/issues/2778

+1
source

Source: https://habr.com/ru/post/1629011/


All Articles