-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
27 lines (22 loc) · 818 Bytes
/
Makefile
File metadata and controls
27 lines (22 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
SHELL=/bin/bash
# Project variables
CONTAINER_NAME ?= vmclarity-tools-base
VERSION ?= $(shell git rev-parse HEAD)
DOCKER_REGISTRY ?= ghcr.io/openclarity
DOCKER_IMAGE ?= $(DOCKER_REGISTRY)/$(CONTAINER_NAME)
DOCKER_TAG ?= ${VERSION}
# HELP
# This will output the help for each task
# thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
.PHONY: help
help: ## This help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.DEFAULT_GOAL := help
.PHONY: docker
docker: ## Build Docker image
@(echo "Building docker image...")
docker build -t $(DOCKER_IMAGE):$(DOCKER_TAG) .
.PHONY: push-docker
push-docker: docker ## Build and Push Docker image
@(echo "Publishing docker image...")
docker push $(DOCKER_IMAGE):$(DOCKER_TAG)