From 8c89bf38d931775d5708664927144e6755388008 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Pab=C3=B3n?= Date: Sun, 21 Oct 2018 13:44:59 -0400 Subject: [PATCH] Update Makefile --- .travis.yml | 12 +++--------- Makefile | 13 +++++++++---- 2 files changed, 12 insertions(+), 13 deletions(-) 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