-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
109 lines (86 loc) · 2.25 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!make
THIS_FILE := $(lastword $(MAKEFILE_LIST))
ifneq (,$(wildcard ./.env))
include .env
export
else
$(error No se encuentra el fichero .env)
endif
ARCH := $(shell docker context use default && docker run --rm alpine uname -m)
help: _header
${info }
@echo Opciones:
@echo ----------------------
@echo start / stop / restart
@echo ----------------------
@echo ps / logs / stats
@echo clean
@echo ----------------------
_header:
${info }
@echo ----------------
@echo Oracle en Docker
@echo ----------------
_colima-start:
@colima start --profile colima-oracle --arch x86_64 --memory 4
_colima-stop:
@colima stop --profile colima-oracle
_colima-delete:
@colima delete --profile colima-oracle -f
_context-colima:
@docker context use colima-oracle
_context-docker-desktop:
@docker context use default
_start_command:
@docker compose up -d --remove-orphans
start:
ifneq ("$(ARCH)", "default aarch64")
@$(MAKE) -f $(THIS_FILE) _start_command
else
@$(MAKE) -f $(THIS_FILE) _colima-start _context-colima _start_command _context-docker-desktop
endif
_stop_command:
@docker compose stop
stop:
ifneq ("$(ARCH)", "default aarch64")
@$(MAKE) -f $(THIS_FILE) _stop_command
else
@$(MAKE) -f $(THIS_FILE) _context-colima _stop_command _colima-stop
endif
restart: stop start
_ps_command:
@docker ps
ps:
ifneq ("$(ARCH)", "default aarch64")
@$(MAKE) -f $(THIS_FILE) _ps_command
else
@$(MAKE) -f $(THIS_FILE) _context-colima _ps_command _context-docker-desktop
endif
_logs_command:
@docker compose logs server
logs:
ifneq ("$(ARCH)", "default aarch64")
@$(MAKE) -f $(THIS_FILE) _logs_command
else
@$(MAKE) -f $(THIS_FILE) _context-colima _logs_command _context-docker-desktop
endif
_stats_command:
@docker stats
stats:
ifneq ("$(ARCH)", "default aarch64")
@$(MAKE) -f $(THIS_FILE) _stats_command
else
@$(MAKE) -f $(THIS_FILE) _context-colima _stats_command _context-docker-desktop
endif
_clean_command:
@docker compose down -v --remove-orphans
clean:
ifneq ("$(ARCH)", "default aarch64")
@$(MAKE) -f $(THIS_FILE) _clean_command
else
@-$(MAKE) -f $(THIS_FILE) _context-colima
@-$(MAKE) -f $(THIS_FILE) _clean_command
@-$(MAKE) -f $(THIS_FILE) _colima-delete
@-$(MAKE) -f $(THIS_FILE) _colima-stop
@-$(MAKE) -f $(THIS_FILE) _context-docker-desktop
endif