diff --git a/.travis.yml b/.travis.yml index 2fe3721f..6dbfd0e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,21 +5,15 @@ services: # Needed for e2e tests sudo: true - go: 1.10.x -go_import_path: github.com/kubernetes-csi/livenessprobe -install: - - go get -u github.com/golang/dep/cmd/dep - - dep ensure -vendor-only - - make livenessprobe script: - go fmt $(go list ./... | grep -v vendor) | wc -l | grep 0 - go vet $(go list ./... | grep -v vendor) - go test $(go list ./... | grep -v vendor) +- make livenessprobe - ./hack/e2e-livenessprobe.sh after_success: - - if [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then - sudo make livenessprobe-container; + - if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}" quay.io; - docker push quay.io/k8scsi/livenessprobe:canary; + make push fi diff --git a/Makefile b/Makefile index cb3f322c..f897a72a 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,9 @@ # limitations under the License. REGISTRY_NAME = quay.io/k8scsi -IMAGE_VERSION = canary +IMAGE_VERSION = canary +IMAGE_NAME=livenessprobe +IMAGE_TAG=$(REGISTRY_NAME)/$(IMAGE_NAME):$(IMAGE_VERSION) .PHONY: all liveness clean test @@ -27,14 +29,17 @@ all: livenessprobe livenessprobe: mkdir -p bin - CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o ./bin/livenessprobe ./cmd + CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o ./bin/livenessprobe ./cmd macos-livenessprobe: mkdir -p bin - CGO_ENABLED=0 GOOS=darwin go build -a -ldflags '-extldflags "-static"' -o ./bin/livenessprobe.osx ./cmd + CGO_ENABLED=0 GOOS=darwin go build -a -ldflags '-extldflags "-static"' -o ./bin/livenessprobe.osx ./cmd livenessprobe-container: livenessprobe - docker build -t $(REGISTRY_NAME)/livenessprobe:$(IMAGE_VERSION) -f ./Dockerfile . + docker build -t $(IMAGE_TAG) -f ./Dockerfile . + +push: livenessprobe-container + docker push $(IMAGE_TAG) clean: rm -rf bin