-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (47 loc) · 1.79 KB
/
Makefile
File metadata and controls
59 lines (47 loc) · 1.79 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
53
54
55
56
57
58
59
DOC_LOADER_SERVER=sirius
TASK_RESULT_PATH=./internal/task_result/task_result_logs
TASK_STATE_PATH=./internal/task_state/task_state_logs
SERVER_REQUESTS_PATH=./internal/server_requests/server_requests_logs
TASK_REQUEST_PATH=./internal/tasks/request_logs
run: build
./${DOC_LOADER_SERVER}
deploy: build_sirius_for_docker
@echo "Stopping docker images (if running...)"
docker-compose down
@echo "Building (when required) and starting docker images..."
docker-compose up --no-build -d
@echo "Docker images built and started!"
fresh_deploy: build_sirius_for_docker
@echo "Stopping docker images (if running...)"
docker-compose down
@echo "Building (when required) and starting docker images..."
docker-compose up --build -d
@echo "Docker images built and started!"
down:
@echo "Stopping docker images"
docker-compose down
@echo "Stopped docker images"
build:
@echo "Building Sirius"
go build -o ${DOC_LOADER_SERVER} ./cmd/api
build_dir:
@echo "Building directory to store task's meta-data and results"
mkdir -p ${TASK_RESULT_PATH}
mkdir -p ${TASK_STATE_PATH}
mkdir -p ${SERVER_REQUESTS_PATH}
mkdir -p ${TASK_REQUEST_PATH}
clean:
@echo "Clean meta-data of task state and task results"
if [ -d ${TASK_RESULT_PATH} ]; then rm -Rf ${TASK_RESULT_PATH}; fi
if [ -d ${TASK_STATE_PATH} ]; then rm -Rf ${TASK_STATE_PATH}; fi
if [ -d ${TASK_REQUEST_PATH} ]; then rm -Rf ${TASK_REQUEST_PATH}; fi
if [ -d ${SERVER_REQUESTS_PATH} ]; then rm -Rf ${SERVER_REQUESTS_PATH}; fi
@echo "Building directory to store task's meta-data and results"
mkdir -p ${TASK_RESULT_PATH}
mkdir -p ${TASK_STATE_PATH}
mkdir -p ${SERVER_REQUESTS_PATH}
mkdir -p ${TASK_REQUEST_PATH}
build_sirius_for_docker:
env GOOS=linux CGO_ENABLED=0 go build -o ${DOC_LOADER_SERVER} ./cmd/api
clean_run: clean run
clean_deploy: clean fresh_deploy