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:
parent
cf305eed74
commit
deecf6265f
10
.travis.yml
10
.travis.yml
@ -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)
|
||||
|
@ -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 .
|
||||
|
Loading…
Reference in New Issue
Block a user