-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtravis.yml
33 lines (28 loc) · 1.31 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
services:
- docker
env:
global:
- IMAGE_NAME="pegaautomationuser/testdocker"
- VERSION="2.1.0-${TRAVIS_REPO_SLUG%%/*}-$TRAVIS_BUILD_NUMBER"
install:
- docker login -u="$DOCKER_USER" -p="$DOCKER_PASS" || true
- curl -L https://github.com/arminc/clair-scanner/releases/download/v8/clair-scanner_linux_amd64 > clair-scanner
- chmod +x clair-scanner
- sudo mv clair-scanner /usr/local/bin
- docker run -d --name db arminc/clair-db
- docker run -p 6060:6060 --link db:postgres -d --name clair arminc/clair-local-scan:v2.0.6
- curl -LO https://storage.googleapis.com/container-structure-test/latest/container-structure-test-linux-amd64 && chmod +x container-structure-test-linux-amd64 && sudo mv container-structure-test-linux-amd64 /usr/local/bin/container-structure-test
script:
- make test
- docker images
- clair-scanner -w tests/cve-scan-whitelist.yaml -c "http://127.0.0.1:6060" --threshold="High" --ip "$(ip -4 addr show docker0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')" $IMAGE_NAME:latest
before_deploy:
- docker login -u="$DOCKER_USER" -p="$DOCKER_PASS"
- docker tag $IMAGE_NAME:latest $IMAGE_NAME:$VERSION #Tag for current version
deploy:
provider: script
script: make push
on:
repo: pegaautomationuser/testdocker
all_branches: true
condition: $TRAVIS_BRANCH =~ ^(v.+|master)$