forked from opendatacube/datacube-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
108 lines (100 loc) · 4.46 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
107
108
---
dist: bionic
sudo: required
services:
- docker
# We always want to be able to reach a tagged version in `git describe`
git:
depth: false
quiet: true
language: python
python:
- '3.6'
matrix:
include:
- env: STABLE_DATACUBE=true
allow_failures:
- env: STABLE_DATACUBE=''
addons:
postgresql: '10'
services:
- postgresql
apt:
packages:
- cython3
- gdal-bin
- gfortran
- libatlas-base-dev
- libgdal-dev
- libhdf5-serial-dev
- liblapack-dev
- libnetcdf-dev
- libproj-dev
- libudunits2-0
- libudunits2-dev
- libxml2-dev
- libxslt-dev
- postgresql-10-postgis-2.4
- shellcheck
- git
before_install:
# Database for the integration tests.
- createdb dea_integration
# Tests should never use the default datacube config, so add a "honeypot" that fails.
- cp .travis/honeypot.conf ~/.datacube.conf
# Set paths for building python-gdal
- export CPLUS_INCLUDE_PATH=/usr/include/gdal
- export C_INCLUDE_PATH=/usr/include/gdal
- export GDAL_DATA="$(gdal-config --datadir)"
# Install pygdal bindings compatible with dpkg based gdal libs
- pip install GDAL==$(gdal-config --version)
install:
- travis_retry pip install --upgrade pip pytest pytest-cov coveralls
- travis_retry pip install -r requirements-test.txt
- |
if [ -z "${STABLE_DATACUBE}" ]; then
echo "Installing latest develop datacube+dea"
travis_retry pip install -U --extra-index-url https://packages.dea.gadevs.ga/ 'datacube' 'digitalearthau'
else
echo "Using stable datacube+dea"
# We already installed datacube+dea stable in requirements.txt
# travis_retry pip install -U --extra-index-url https://packages.dea.gadevs.ga/ 'digitalearthau==20180116+268.g391cbc0'
# Stable datacube has an issue on alchemy 1.3: https://github.com/opendatacube/datacube-core/pull/680
travis_retry pip install 'sqlalchemy==1.2.*'
fi
- pip install .[test]
script:
- make lint
- make test
after_success:
- ls -lha
- coveralls
notifications:
slack:
on_success: change
on_failure: always
on_pull_requests: false
rooms:
secure: XuckJxUiZGuprePxfosIwa+Q1MZXo+bsSmBeKGGK0Ep7EBn4GxbLsJ2XZACPqoPRePH5qHseg1FuHtXx1u0AcnEZ9wX9RHd3mx7TiY2fbE8TWN+vjOvfCxU/qraQxmdPrXja7Y7+OFxjhOKtVb6t2jHlQPpaXUq5Xo/L+73+Tr6IQuQctYCjEiJDtYNJqi8akMT29L9qmPWcYPcXyVpj0KMa8Db1YOkgal/OXqi/Uv5ZijXRERejDcudcaKk1pTL2aV/JUqXjaneEQoJL4dGBOYiWbS+Ye27XDyryHT2caFeH5cJ4KFn/T+3X49DtbjIZqR5pACQeKaAWm5iOKMP+GfonQxh6+4GUqgssn6d9/QWs0GsVtJcN/Rbq/kVMjX7anS5pJfUhiV63hfWIYzTXt1cuNXpupuVyOJLUZCcRyyKkFFLBXJcFPQ07UWofxj8ipa+SWvY24411VpvnANGqfuOTj/ZTQrM8SVVuPITjOn8AUX34ZqcHGajIlkcJKl0vEZZOExsdhgeZYRs24CZ4u4/EcGjJy9GgiXim5gBJbzPF7fDWjQ1oyIrLtdSvi2H/zX9vaKhsgbeRiLY6X3xdEq3APCWzswK+d5lzgfRjd9RxDC5yH8a22l4mhcHQQ9XqmC52AcUZv/QDHeN5qyKL07y09xxAwOqlQYmjP5XyVg=
jobs:
include:
- stage: test
script:
- docker build -t opendatacube/dashboard:latest .
# Start the Clair database and Clair locally or while running your job
- docker run -d --name clair_db arminc/clair-db:latest
- docker run -p 6060:6060 --link clair_db:postgres -d --name clair arminc/clair-local-scan:v2.0.8_fe9b059d930314b54c78f75afe265955faf4fdc1
- stage: build
if: (branch = develop OR (tag = branch)) AND type = push
script:
# Start the Clair database and Clair locally or while running your job
- docker run -d --name clair_db arminc/clair-db:latest
- docker run -p 6060:6060 --link clair_db:postgres -d --name clair arminc/clair-local-scan:v2.0.8_fe9b059d930314b54c78f75afe265955faf4fdc1
- export DEV_TAG=$(git describe --tags | awk -F'[-.]' '{if ($4!="" && $5!="") print $2"."$3+1"."$4"."$5; else print $2"."$3;}')
- docker build -t opendatacube/dashboard:$DEV_TAG -t opendatacube/dashboard:latest .
# ens4 is specific to Travis Xenial should be changed if moving to another OS / CI provider
- "wget https://github.com/arminc/clair-scanner/releases/download/v8/clair-scanner_linux_amd64 && chmod +x clair-scanner_linux_amd64 && ./clair-scanner_linux_amd64 --threshold='High' --report='clair-scan.json' --ip $(ifconfig ens4 | grep 'inet addr' | cut -d: -f2 | awk '{print $1}') --reportAll=false opendatacube/dashboard:latest"
# Now that your Docker image is built and contains application code, upload it into a public registry.
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker push opendatacube/dashboard:$DEV_TAG
- docker push opendatacube/dashboard:latest