Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
124 lines (120 sloc) 7.24 KB
---
# yamllint disable rule:line-length
sudo: required
dist: trusty
services:
- docker
language: node_js
node_js:
- '6'
cache:
directories:
- node_modules
before_install:
- |
git config --global user.email "travis@welder.web"
git config --global user.name "Travis CI"
git remote add welder https://github.com/weldr/welder-web.git
git fetch welder
git log -1 --pretty=format:%H welder/master
git rebase welder/master
npm install -g codecov
npm install -g nyc@11.1.0
if [ "$COMMAND" == "bdcs-test" ]; then
sudo docker pull welder/web-e2e-tests:latest
sudo docker pull welder/web-bdcs:latest
fi
if [ "$COMMAND" == "lorax-test" ]; then
sudo docker pull welder/web-lorax:latest
sudo docker pull welder/web-e2e-tests:latest
fi
install:
- |
if [ "$COMMAND" != "bdcs-test" ]; then
npm install
fi
if [ "$COMMAND" == "lorax-test" ]; then
npm rebuild
node run build --with-coverage
fi
env:
global:
- CXX=g++-4.8
- secure: Q9X11ehcl4YE0ylxDGk8NgVeO7nIpqWiI9am2GA6JVXcxeYYcLf3NHGe1JiLwFQ/xSq4KJrY0IgpivkVrPwTOojpR/tRG5QNDR/IJzN/6PV0IAWkHjPDKZexCQmy4IoPFib/cWqxo46V/JZ+gzs/TJugkl5/QpTcGlCr+d7VkuA80Bj0nlQO5GevYVgYMCrN6u6cKNOWtNQ0gppxHrpsLo36MpHqHbNbv236GPGsV4K2qpiqvvO5ogD+LCv5xoKEZK0ext4FNrrZFq6XEYdy9uUaUbSFfoG+HXESXbIt0L7krQDT/PkKI0X4nM91eYl5mS63+HVue7vLiijS5h9+YCa8HblMIiAiyrR3lPPH0Hx4FVSrQfkvtoXMBs3nRt7keu2FG370a7WoaQ71Q2jHrI9cfYzRwa/Mok73eF/oeN32hPlPDD679hWOZYqbSksSTikCLIgwJpEgIfaHgEYXFmL2JFXk0HbgIciA+C9fE0rfaUbmARtWYq8c+b52aIxAHEV9zYy3JeARrYxk7s3jQgS/LZIw4rfso+bQIvEMUDWt8MnvKaecY1E7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7UkBSG2x7EdMLmUXPPipsySOVk=
- secure: OczCF0tkzLemUci4nQwVKuwyz8NCl3vTNUAF8k/bvFxi1blaTU5HRdws7LtcjlXFx7WuJba+E6Jd2FaZxOzLqypADgf1U/7lPNx2aODDTfM6+eYPZJQnylCkePcJH5Wu/ew9+xFDnG1WQuJWe5sWrrIlX//6L+F0pZKfur49mipRcHDp2zU8rN2HRALhK08RRP9un5V0Wrp1R4THGFbciqZbHMw9LKld6inY9+3cwAvXuTdTbF8bhaFuqK8cYb0ekl33MmF2WzN1z33bLmaihZV1jBz0sx3JqiUZXV5pdupQ6BC0RcgAGqJHKWbZ/tZ4v1QDPEHQVbsNkLZ94IOUKKnxJ6zpvgKM3iX9C/vABy31CndX9qKnmQ02KQJYwyR0FPGX1ln0+GgxERhGMytsSHD3rrhBIalPNhl281VvP0JopU6uhyzOgfv1dglioNKa7Q6TQ57ytF+Jl3nn/yBL7PgKCyqbQmgSvIFbxeLMUUu00BiNrD64Zr2WnN5u8fmtE/7WefgAKRmNj/5mVj3CPDOJUKL4c5IaLA9vew5So4IuSBxZUPNoT2NQM+QcjcjVGH9jyIqM94Dsk2hAXYq2maSDLWWubJrkau6y3FHT3XDVsLa9hSMMryGk0JT1X0b20yZKBHEflobav26RrTpZJg+sTLK09s6xlW/EABEDMro=
- ZANATA_USER=dshea
matrix:
- COMMAND=eslint
- COMMAND=stylelint
- COMMAND=unit-test
- COMMAND=lorax-test
- COMMAND=bdcs-test
script:
- make "$COMMAND"
jobs:
include:
- stage: deploy
script: make po-push
env: COMMAND=none
if: branch = master AND type = push
after_success:
- if [ "$COMMAND" == "unit-test" ]; then cat ./coverage/lcov.info | codecov; fi
- |
if [ "$COMMAND" == "lorax-test" ]; then
nyc report
nyc report --reporter=lcov && codecov
fi
if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
docker login -u atodorov -p $DOCKER_PASSWORD
if [ "$COMMAND" == "lorax-test" ]; then
# tag the current builds with the build number
# if nothing has been changed the push will detect that
# and the new tag will appear on Docker Hub without anything being
# actually uploaded
sudo docker tag welder/web-lorax:latest welder/web-lorax:$TRAVIS_BUILD_NUMBER
sudo docker tag welder/web-e2e-tests:latest welder/web-e2e-tests:$TRAVIS_BUILD_NUMBER
docker push welder/web-lorax
docker push welder/web-e2e-tests
fi
if [ "$COMMAND" == "bdcs-test" ]; then
sudo docker tag welder/web-bdcs:latest welder/web-bdcs:$TRAVIS_BUILD_NUMBER
docker push welder/web-bdcs
fi
fi
after_failure:
- |
if [ "$TRAVIS_TEST_RESULT" ]; then
CASE_NUMBER=0
for SCREENSHOT in `ls ./failed-image`
do
CASE_NUMBER=$(($CASE_NUMBER + 1))
REFERRER_COMMIT="$TRAVIS_COMMIT"
if [ -n "$TRAVIS_PULL_REQUEST_SHA" ]; then
REFERRER_COMMIT="$TRAVIS_PULL_REQUEST_SHA"
fi
curl -s -X POST \
-H "User-Agent: weldr team CI" \
-H "Authorization: token $GITHUB_API_TOKEN" \
-d '{"state": "failure", "target_url": "https://s3.amazonaws.com/weldr/web-fail-test-screenshot/'$TRAVIS_BUILD_NUMBER'/'$SCREENSHOT'", "description": "Failed on '$COMMAND'", "context": "Screenshot for failed case '$CASE_NUMBER' on '$COMMAND'"}' \
https://api.github.com/repos/$TRAVIS_REPO_SLUG/statuses/$REFERRER_COMMIT
done
fi
addons:
artifacts:
debug: true
paths: "./failed-image"
target_paths: web-fail-test-screenshot/$TRAVIS_BUILD_NUMBER
bucket: weldr
s3_region: us-east-1
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
notifications:
email:
on_failure: change
on_success: never