1
- PERSISTENT_SERVICES := db traefik kibana elasticsearch-coordinating redis-master logstash
1
+ PERSISTENT_SERVICES := db traefik kibana elasticsearch-coordinating redis-master
2
2
RESTART_ALWAYS_SERVICES := api web-dev rpc-default rpc-theia rpc-regrade
3
3
PUSH_SERVICES := api web theia-init theia-proxy theia-admin theia-xv6
4
4
5
-
6
-
7
- CURRENT_DIR := $(shell basename $$(pwd ) | tr '[:upper:]' '[:lower:]')
8
- IMAGES := $(shell \
9
- ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF) )' \
10
- docker-compose.yml | jq '.services | .[].image | select(.!=null)' -r \
11
- 2> /dev/null \
12
- )
13
- BUILT_IMAGES := $(shell \
14
- docker image ls | \
15
- awk '{print $$1}' | \
16
- grep -P '^($(CURRENT_DIR ) _|os3224-) ' \
17
- 2> /dev/null \
18
- )
19
- RUNNING_CONTAINERS := $(shell docker-compose ps -q)
20
- VOLUMES := $(shell docker volume ls | awk '{if (match($$2, /^anubis_.* $$/) ) {print $$2}}')
21
-
22
-
23
5
help :
24
6
@echo ' For convenience'
25
7
@echo
26
8
@echo ' Available make targets:'
27
9
@grep PHONY: Makefile | cut -d: -f2 | sed ' 1d;s/^/make/'
28
10
11
+ startup-links :
12
+ @echo ' '
13
+ @echo ' seed: http://localhost/api/admin/seed/'
14
+ @echo ' auth: http://localhost/api/admin/auth/token/superuser'
15
+ @echo ' auth: http://localhost/api/admin/auth/token/ta'
16
+ @echo ' auth: http://localhost/api/admin/auth/token/professor'
17
+ @echo ' site: http://localhost/'
18
+
29
19
.PHONY : deploy # Deploy Anubis to cluster
30
20
deploy :
31
21
./k8s/deploy.sh
40
30
docker-compose build --parallel --pull $(PUSH_SERVICES )
41
31
docker-compose push $(PUSH_SERVICES )
42
32
43
- startup-links :
44
- @echo ' '
45
- @echo ' seed: http://localhost/api/admin/seed/'
46
- @echo ' auth: http://localhost/api/admin/auth/token/superuser'
47
- @echo ' auth: http://localhost/api/admin/auth/token/ta'
48
- @echo ' auth: http://localhost/api/admin/auth/token/professor'
49
- @echo ' site: http://localhost/'
50
-
51
33
.PHONY : debug # Start the cluster in debug mode
52
34
debug :
53
35
docker-compose up -d $(PERSISTENT_SERVICES )
@@ -62,23 +44,23 @@ debug:
62
44
63
45
.PHONY : mindebug # Start the minimal cluster in debug mode
64
46
mindebug :
65
- docker-compose up -d traefik db redis-master logstash
47
+ docker-compose up -d traefik db redis-master
66
48
docker-compose up \
67
49
-d --force-recreate \
68
- api web-dev rpc-default rpc-theia
50
+ api web-dev rpc-default
69
51
@echo ' Waiting a moment before running migrations'
70
52
sleep 3
71
53
@echo ' running migrations'
72
54
make -C api migrations
73
55
make startup-links
74
56
75
- .PHONY : mkdebug # Start minikube debug
76
- mkdebug :
57
+ .PHONY : debug-mk # Start minikube debug
58
+ debug-mk :
77
59
./k8s/debug/provision.sh
78
60
make startup-links
79
61
80
- .PHONY : mkrestart # Restart minikube debug
81
- mkrestart :
62
+ .PHONY : restart-mk # Restart minikube debug
63
+ restart-mk :
82
64
./k8s/debug/restart.sh
83
65
make startup-links
84
66
@@ -87,20 +69,3 @@ yeetdb:
87
69
docker-compose rm -f
88
70
docker volume rm anubis_db_data
89
71
docker-compose up -d --force-recreate db
90
-
91
- .PHONY : clean # Clean up volumes, images and data
92
- clean :
93
- docker-compose kill
94
- if [ -n " $( RUNNING_CONTAINERS) " ]; then \
95
- docker rm -f $(RUNNING_CONTAINERS ) ; \
96
- fi
97
- if [ -n " $( IMAGES) " ]; then \
98
- docker rmi -f $(IMAGES ) ; \
99
- fi
100
- if [ -n " $( BUILT_IMAGES) " ]; then \
101
- docker rmi -f $(BUILT_IMAGES ) ; \
102
- fi
103
- if [ -n " ${VOLUMES} " ]; then \
104
- docker volume rm $(VOLUMES ) ; \
105
- fi
106
- docker system prune -f
0 commit comments