-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (52 loc) · 1.54 KB
/
Makefile
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
#----------------------GO----------------------
appName ?= serverBinary
RELEASE_NAME ?= bookserver-api-mysql
build-binary:
@echo building Binary.....
go build -o ${appName} .
git-push:
git add .; git commit -m "From MakeFile"; git push
run-binary: build-binary
./${appName} startServer -a=false
#------------------------Helm---------------------
helm-install:
@echo helm-chart installing.....
helm install ${RELEASE_NAME} helmChart
helm-uninstall:
@echo helm-chart Un-installing.....
helm uninstall ${RELEASE_NAME}
#------------------------Docker--------------------
DOCKER_USER:=anisurrahman75
COMPOSE_FILE_PATH := -f docker-compose.yaml
IMAGE := anisurrahman75/bookserver-api-mysql
TAG:=latest
compose-build:
$(info Make: docker compose building.....)
docker-compose $(COMPOSE_FILE_PATH) build --no-cache
@make -s clean
compose-start:
$(info Make: docker compose starting.....)
docker-compose $(COMPOSE_FILE_PATH) up
compose-stop:
$(info Make: Stopping containers.....)
docker-compose $(COMPOSE_FILE_PATH) stop
compose-down:
$(info Make: Stopping containers.....)
docker-compose $(COMPOSE_FILE_PATH) down
compose-restart:
$(info Make: Restarting containers......)
@make -s stop
@make -s start
docker-push:
$(info Make: Pushing image.....)
@docker push $(IMAGE):$(TAG)
docker-pull:
$(info Make: Pulling image.....)
@docker pull $(IMAGE):$(TAG)
docker-clean:
@docker system prune --volumes --force
docker-system-clean:
@docker system prune -a
docker-login:
$(info Make: Login to Docker Hub.)
@docker login -u $(DOCKER_USER) -p $(DOCKER_PASS)