Skip to content

Commit

Permalink
Merge pull request #97 from bcrochet/image-make
Browse files Browse the repository at this point in the history
Add image build and push to the Makefile
  • Loading branch information
openshift-merge-robot committed Oct 21, 2020
2 parents 49d42f9 + 1c8e88d commit c7ce890
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
.DEFAULT_GOAL:=help

IMAGE_REGISTRY ?= quay.io
IMAGE_REPO ?= $(USER)
IMAGE_NAME ?= origin-baremetal-runtimecfg
IMAGE_BUILDER ?= podman
IMAGE_DOCKERFILE ?= Dockerfile

.PHONY: fmt
fmt: ## Run go fmt against code
go fmt ./pkg/... ./cmd/...
Expand All @@ -18,3 +24,11 @@ docker_test: ## Run test target on docker
.PHONY: vet
vet: ## Run go vet against code
go vet ./pkg/... ./cmd/...

.PHONY: image
image: ## Build a local image
$(IMAGE_BUILDER) build -t $(IMAGE_REGISTRY)/$(IMAGE_REPO)/$(IMAGE_NAME) -f $(IMAGE_DOCKERFILE) .

.PHONY: push
push: image ## Push the image to the registry. Will attempt to build the image first
$(IMAGE_BUILDER) push $(IMAGE_REGISTRY)/$(IMAGE_REPO)/$(IMAGE_NAME)

0 comments on commit c7ce890

Please sign in to comment.