Skip to content

Commit

Permalink
Merge pull request #16 from kubernetes-csi/update
Browse files Browse the repository at this point in the history
Update Makefile
  • Loading branch information
lpabon authored Oct 23, 2018
2 parents c8dfd96 + 8c89bf3 commit ea3257d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
12 changes: 3 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit ea3257d

Please sign in to comment.