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

Add image build and push to the Makefile #97

Merged
merged 1 commit into from
Oct 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

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