Skip to content
Snippets Groups Projects
Unverified Commit deecf626 authored by Yoav Rotem's avatar Yoav Rotem Committed by GitHub
Browse files

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
parent cf305eed
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,10 @@ before_install: ...@@ -13,7 +13,10 @@ before_install:
- pip install --user yamllint==1.18.0 - pip install --user yamllint==1.18.0
- gem install --no-document fpm - gem install --no-document fpm
- go get -t -v ./... - 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: script:
- yamllint -c ./.yamllint.yaml . - yamllint -c ./.yamllint.yaml .
...@@ -28,7 +31,10 @@ script: ...@@ -28,7 +31,10 @@ script:
- test -d cfg - test -d cfg
- test -f kube-bench - test -f kube-bench
# Build and push the multi-arch Docker image # 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: after_success:
- bash <(curl -s https://codecov.io/bash) - bash <(curl -s https://codecov.io/bash)
......
FROM golang:1.14.0 AS build FROM golang:1.15.0 AS build
WORKDIR /go/src/github.com/aquasecurity/kube-bench/ WORKDIR /go/src/github.com/aquasecurity/kube-bench/
COPY go.mod go.sum ./ COPY go.mod go.sum ./
COPY main.go . COPY main.go .
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment