1
0
mirror of https://github.com/aquasecurity/kube-bench.git synced 2024-12-23 23:18:33 +00:00

Test Travis build condition (#713)

* Add condition to make docker

Build and push Docker image only when pushing to master.

* Update to Golang 1.15

As https://github.com/aquasecurity/kube-bench/pull/706 did, just doing it in my fork to test Travis changes about the build
This commit is contained in:
Yoav Rotem 2020-10-01 18:37:38 +03:00 committed by GitHub
parent cf305eed74
commit deecf6265f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -13,7 +13,10 @@ before_install:
- pip install --user yamllint==1.18.0
- gem install --no-document fpm
- go get -t -v ./...
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
- |
if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
fi
script:
- yamllint -c ./.yamllint.yaml .
@ -28,7 +31,10 @@ script:
- test -d cfg
- test -f kube-bench
# Build and push the multi-arch Docker image
- make docker
- |
if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then
make docker
fi
after_success:
- bash <(curl -s https://codecov.io/bash)

View File

@ -1,4 +1,4 @@
FROM golang:1.14.0 AS build
FROM golang:1.15.0 AS build
WORKDIR /go/src/github.com/aquasecurity/kube-bench/
COPY go.mod go.sum ./
COPY main.go .