forked from opendatacube/datacube-ows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
31 lines (31 loc) · 1.6 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
dist: xenial
sudo: required # Use the new travis docker based infrastructure
services:
- docker
git:
# We need a deeper depth for 'git descibe' to ensure
# we can reach the last tagged version.
depth: 99999
language: python
python:
# We don't use the travis python, but we will use it for the build matrix
- "3.6"
jobs:
include:
- stage: test
script:
- docker build -t opendatacube/ows:latest .
- docker run opendatacube/ows:latest /bin/sh -c "./check-code.sh"
- ifconfig
- stage: build
if: (branch = master OR (tag = branch)) AND type = push
script:
- 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.5
- export WMS_TAG=$(git describe --tags | awk -F'[-.]' '{if ($4!="" && $5!="") print $1"."$2"."$3+1"-unstable."$4"."$5; else print $1"."$2"."$3;}')
- docker build -t opendatacube/ows:$WMS_TAG -t opendatacube/ows: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/ows:latest"
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker push opendatacube/ows:$WMS_TAG
- docker push opendatacube/ows:latest