forked from GDG-Ukraine/gdg.org.ua
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
104 lines (93 loc) · 2.87 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
_base_job: &_base_job
language: python
python: 3.6
# Run in ubuntu-trusty VM
dist: trusty
sudo: required
# Multienv testing
matrix:
# Marks build successful regardless of whether allowed-failures finished
fast_finish: true
install: skip
before_script: skip
script: skip
_base_vagga_job: &_base_vagga_job
<<: *_base_job
# OS packages
addons:
apt:
packages: [vagga]
sources:
- sourceline: >-
deb [arch=amd64 trusted=yes] http://ubuntu.zerogw.com vagga-testing main
before_script: vagga --version
# Cleanup useless stuff: unused containers and all persistent volumes
before_cache:
- vagga _clean --unused --volumes
# Remove problematic folder, it's empty anyway:
- rm -rf .vagga/.cache/apt-cache/archives/partial
# Cache .vagga images to speedup sequential builds
cache:
timeout: 21600 # 6 hours
pip: true
directories:
- .travis/.vagga-cache
- .vagga/.cache
jobs:
include:
- stage: build Vagga test container
<<: *_base_vagga_job
# Tell vagga to fetch ubuntu images from certain location
before_install:
- export APP_SHASH=`vagga _version_hash --short app`
- export TEST_SHASH=`vagga _version_hash --short test`
- |
if [ -f ".travis/.vagga-cache/app.${APP_SHASH}.tar.xz" -a -f ".travis/.vagga-cache/test.${TEST_SHASH}.tar.xz" ]
then
export SKIP_VAGGA_BUILD=true
echo Skipping containers build stage since they already exist in cache
else
echo Building containers for reuse in subsequent stages
cp -v .travis/.vagga.yaml ~/
fi
install: |
if [ "$SKIP_VAGGA_BUILD" != true ]
then
vagga _build test
fi
script: |
if [ "$SKIP_VAGGA_BUILD" != true ]
then
vagga _push_image app &
vagga _push_image test &
wait
fi
- stage: &tests_label tests and linters
<<: *_base_vagga_job
script: vagga lint
- stage: *tests_label
<<: *_base_vagga_job
install: pip install codecov
script: vagga test
after_success: bash <(curl -s https://codecov.io/bash) -cF python -f '!./.vagga/.*' -Z
- stage: deploy
if: branch = master
<<: *_base_job
deploy:
provider: script
script: .travis/deploy.sh
on:
#all_branches: true
branch: master
python: 3.6
#tags: true
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/1001e872f956d15468ae
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: always
slack:
secure: US4JF4c+qvMJ3I2eg7jEKpo/mloest1HNhZrVje+ZEtKz6mvpx2uzxBsQahBgbD1I/v2S09qSu7nhImjJNmCVji59c81pTLcuUS4FfvDtUlke3ie7K7hFZbB5MEWTjvGyKUTjrsvKjYvuFFIb09C/es+MBRNHY54JTT85Jkh3SM=
# vim:ft=yaml: et ts=2 sts=2 sw=2 tw=79 autoindent smartindent