forked from controlplaneio/kubesec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
45 lines (39 loc) · 1.14 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
sudo: required
language: go
go:
- 1.12.x
services:
- docker
addons:
apt:
packages:
- docker-ce
- parallel
script:
- set -e
- make test-go-fmt
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- dep ensure -vendor-only
- go test -v -race -coverprofile=coverage.txt -covermode=atomic ./pkg/...
- make build test-acceptance
- docker build -t kubesec .
- docker run -dp 8080:8080 kubesec
- sleep 1
- curl -sSX POST --data-binary @test/asset/score-0-daemonset-host-network.yml http://localhost:8080/scan | grep loopback
- curl -sSX POST --data-binary @test/asset/invalid-schema.yml http://localhost:8080/scan | grep Invalid
after_success:
- if [ -z "$DOCKER_USER" ]; then
echo "Skipping image push! Docker Hub credentials not found";
else
BRANCH_COMMIT=$(echo ${TRAVIS_COMMIT} | head -c7);
docker tag kubesec:latest kubesec/kubesec:${BRANCH_COMMIT};
echo $DOCKER_PASS | docker login -u=$DOCKER_USER --password-stdin;
docker push kubesec/kubesec:${BRANCH_COMMIT};
fi
deploy:
- provider: script
skip_cleanup: true
script: curl -sL http://git.io/goreleaser | bash
on:
branch: master
tags: true