Skip to content

Commit

Permalink
Update Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
lpabon committed Oct 21, 2018
1 parent c8dfd96 commit 2fe321a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ script:
- go test $(go list ./... | grep -v vendor)
- ./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 2fe321a

Please sign in to comment.