-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (43 loc) · 1.13 KB
/
Makefile
File metadata and controls
52 lines (43 loc) · 1.13 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
APP_NAME = k8s-custom-controller
DOCKER_USER = manzilrahul
VERSION ?= 1.0.18
IMAGE_NAME = $(DOCKER_USER)/$(APP_NAME)
# 🖼️ Logo banner
define ascii_banner
@cat banner.txt
endef
print-vars:
$(call ascii_banner)
@echo "🔧 APP_NAME = $(APP_NAME)"
@echo "👤 DOCKER_USER = $(DOCKER_USER)"
@echo "🏷️ VERSION = $(VERSION)"
@echo "📦 IMAGE_NAME = $(IMAGE_NAME)"
run:
$(call ascii_banner)
@echo "▶️ Running Go app locally..."
go run main.go
build:
$(call ascii_banner)
@echo "🛠️ Building Go binary..."
go build -o $(APP_NAME)
fmt:
$(call ascii_banner)
@echo "🧹 Formatting Go code..."
go fmt ./...
up:
$(call ascii_banner)
@echo "📦 Starting Docker Compose..."
docker-compose up --build
down:
$(call ascii_banner)
@echo "🛑 Stopping Docker Compose..."
docker-compose down
build-image:
$(call ascii_banner)
@echo "🐳 Building Docker image $(IMAGE_NAME):$(VERSION) and :latest..."
docker build -t $(IMAGE_NAME):$(VERSION) -t $(IMAGE_NAME):latest .
push-image:
$(call ascii_banner)
@echo "📤 Pushing Docker image..."
docker push $(IMAGE_NAME):$(VERSION)
docker push $(IMAGE_NAME):latest