Removed all conditional checks in travis

This commit is contained in:
Alejandro Celaya
2020-06-10 18:43:11 +02:00
parent e26cdc11c3
commit b310d79110

View File

@@ -2,50 +2,31 @@ dist: bionic
language: node_js language: node_js
jobs: branches:
fast_finish: true only:
include: - /.*/
- name: "Docker publish"
node_js: '12.16.3' services:
if: NOT type = pull_request - docker
env:
- DOCKER_PUBLISH="true"
- name: "CI"
node_js: '12.16.3'
env:
- DOCKER_PUBLISH="false"
allow_failures:
- name: "Docker publish"
cache: cache:
directories: directories:
- node_modules - node_modules
services: jobs:
- docker fast_finish: true
include:
install: - name: "Docker publish"
- if [[ ${DOCKER_PUBLISH} == 'true' ]]; then sudo bash ./scripts/docker/install-docker ; fi if: NOT type = pull_request
- if [[ ${DOCKER_PUBLISH} == 'false' ]]; then npm ci ; fi install: sudo bash ./scripts/docker/install-docker
script: bash ./scripts/docker/build
before_script: # Overwrite all common steps that have to be different
- if [[ ${DOCKER_PUBLISH} == 'false' ]]; then echo "Building commit range ${TRAVIS_COMMIT_RANGE}" ; fi before_script: echo "Before script"
- if [[ ${DOCKER_PUBLISH} == 'false' ]]; then export MUTATION_FILES=$(git diff ${TRAVIS_COMMIT_RANGE:-origin/master} --name-only | grep -E 'src\/(.*).(js|ts|jsx|tsx)$' | paste -sd ",") ; fi after_success: echo "After success"
- name: "CI"
script: node_js: '12.16.3'
- if [[ ${DOCKER_PUBLISH} == 'true' ]]; then bash ./scripts/docker/build ; fi
- if [[ ${DOCKER_PUBLISH} == 'false' ]]; then npm run lint ; fi
- if [[ ${DOCKER_PUBLISH} == 'false' ]]; then npm run test:ci ; fi
- if [[ ${DOCKER_PUBLISH} == 'false' ]]; then docker build -t shlink-web-client:test . ; fi
- if [[ ${DOCKER_PUBLISH} == 'false' ]]; then npm run mutate:ci ; fi
after_success:
- if [[ ${DOCKER_PUBLISH} == 'false' ]]; then node_modules/.bin/ocular coverage/clover.xml ; fi
# Before deploying, build dist file for current travis tag # Before deploying, build dist file for current travis tag
before_deploy: before_deploy: npm run build ${TRAVIS_TAG#?}
- if [[ ! -z $TRAVIS_TAG && ${DOCKER_PUBLISH} == 'false' ]]; then npm run build ${TRAVIS_TAG#?} ; fi
deploy: deploy:
- provider: releases - provider: releases
api_key: api_key:
@@ -53,6 +34,20 @@ deploy:
file: "./dist/shlink-web-client_${TRAVIS_TAG#?}_dist.zip" file: "./dist/shlink-web-client_${TRAVIS_TAG#?}_dist.zip"
skip_cleanup: true skip_cleanup: true
on: on:
all_branches: true
condition: ${DOCKER_PUBLISH} == 'false'
tags: true tags: true
install:
- npm ci
before_script:
- echo "Building commit range ${TRAVIS_COMMIT_RANGE}"
- export MUTATION_FILES=$(git diff ${TRAVIS_COMMIT_RANGE:-origin/master} --name-only | grep -E 'src\/(.*).(js|ts|jsx|tsx)$' | paste -sd ",")
script:
- npm run lint
- npm run test:ci
- docker build -t shlink-web-client:test .
- npm run mutate:ci
after_success:
- node_modules/.bin/ocular coverage/clover.xml