forked from osbuild/cockpit-composer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
106 lines (103 loc) · 6.23 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
sudo: required
dist: trusty
services:
- docker
language: node_js
node_js:
- '6'
cache:
directories:
- node_modules
before_install:
- |
git config --global user.email "[email protected]"
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 [email protected]
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
node run build --with-coverage
fi
env:
global:
- secure: Q9X11ehcl4YE0ylxDGk8NgVeO7nIpqWiI9am2GA6JVXcxeYYcLf3NHGe1JiLwFQ/xSq4KJrY0IgpivkVrPwTOojpR/tRG5QNDR/IJzN/6PV0IAWkHjPDKZexCQmy4IoPFib/cWqxo46V/JZ+gzs/TJugkl5/QpTcGlCr+d7VkuA80Bj0nlQO5GevYVgYMCrN6u6cKNOWtNQ0gppxHrpsLo36MpHqHbNbv236GPGsV4K2qpiqvvO5ogD+LCv5xoKEZK0ext4FNrrZFq6XEYdy9uUaUbSFfoG+HXESXbIt0L7krQDT/PkKI0X4nM91eYl5mS63+HVue7vLiijS5h9+YCa8HblMIiAiyrR3l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XjN8Xt8noqeSdLkJ2JSOOB63zq298mgGa9fXGpCaKjGwoiiRzCcwyoKwcO+QyStvJuI2HlGQAwJ9LHiJ88tiovLxfr/TDxgFr/+PhlAF1gD+2gooiIvIwAEafG/6ghqBNUhiKJV4w1Zh7EVfgL8OcXbydU0dc/fllj6SRPg9ZcYHmfDVZoR8OOKBdP6VDQiJ5bX5UZaQgp7UkBSG2x7EdMLmUXPPipsySOVk=
matrix:
- COMMAND=eslint
- COMMAND=stylelint
- COMMAND=unit-test
- COMMAND=lorax-test
- COMMAND=bdcs-test
script:
- make "$COMMAND"
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
notifications:
email:
on_failure: change
on_success: never