Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Makefile #16

Merged
merged 1 commit into from
Oct 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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