forked from sedici/docker-dspace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (44 loc) · 2.18 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
include .env
.PHONY: up update install down stop prune ps bash logs dsbin
default: up
up:
@echo "Starting up containers for $(PROJECT_NAME)..."
docker-compose -f docker-compose.yml -f others/docker-compose-debug.yml up -d
update:
@echo "Stopping containers for $(PROJECT_NAME)..."
@docker-compose -f docker-compose.yml -f others/docker-compose-debug.yml stop
docker-compose -f docker-compose.yml -f others/docker-compose-debug.yml run dspace update
sudo chown -R $(id -u):$(id -g) data/*
@echo "Starting up containers for $(PROJECT_NAME)..."
docker-compose -f docker-compose.yml -f others/docker-compose-debug.yml up -d
install:
docker-compose -f docker-compose.yml -f others/docker-compose-debug.yml run dspace install
sudo chown -R $(id -u):$(id -g) data/*
reset-db:
docker-compose -f docker-compose.yml -f others/docker-compose-debug.yml run dspace reset-db
index-discovery:
@echo "[HELP!] Define \"PARAMS\" variable if wants to pass specifics parameters to 'index-discovery' command... In example 'make PARAMS=\"-b\" index-discovery'"...
@if [ -f "data/install/bin/dspace" ]; then echo "Running \"index-discovery $(PARAMS)\"..."; docker exec -it $(PROJECT_NAME) /dspace/install/bin/dspace index-discovery "$(PARAMS)"; echo "Exiting..."; fi
dsbin:
@echo "[HELP!] Define \"COMMAND\" variable if wants to pass specifics command to 'bin/dspace' DSpace's CLI... In example 'make COMMAND=\"dsprop -p dspace.dir\" dsbin'"...
@if [ -f "data/install/bin/dspace" ]; then echo "Running \"bin/dspace $(COMMAND)\"..."; docker exec -it $(PROJECT_NAME) /dspace/install/bin/dspace $(COMMAND); echo "Exiting..."; fi
down: stop
stop:
@echo "Stopping containers for $(PROJECT_NAME)..."
@docker-compose -f docker-compose.yml -f others/docker-compose-debug.yml stop
prune:
@echo "Removing containers for $(PROJECT_NAME)..."
@docker-compose down -v
ps:
@docker ps --filter name='$(PROJECT_NAME)*'
bash:
docker exec -i -t 'dspace_$(PROJECT_NAME)' /bin/bash
logs:
@docker-compose logs -f $(filter-out $@,$(MAKECMDGOALS))
log:
tail -f data/install/log/$(filter-out $@,$(MAKECMDGOALS)).log
less:
less -N data/install/log/$(filter-out $@,$(MAKECMDGOALS)).log
# https://stackoverflow.com/a/6273809/1826109
%:
@: