-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGNUmakefile
More file actions
141 lines (97 loc) · 3.07 KB
/
GNUmakefile
File metadata and controls
141 lines (97 loc) · 3.07 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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# GNUmakefile
# Copyright (C) 2018 "Michael G. Morey" <mgmorey@gmail.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
APP_PORT := 5000
home := $(shell scripts/get-real-user-home)
tag := $(shell date +%Y%m%d%H%M)
all: .env .update pytest
clean: clean-app-caches
clean-app-caches:
$(home)/bin/clean-up-app-caches
clean-virtualenv:
$(home)/bin/clean-up-virtualenv
client: .env
clients/app-test
client-debug: .env
clients/app-test -h localhost -p $$(($(APP_PORT) + 1))
create-database:
create-app-database || true
run-app python3 -m app create-database
docker-build: .env Dockerfile
docker-app -t $(tag) build
docker-compose: .env-api .env-mysql .env-postgres Dockerfile
docker-compose up --build
docker-pull:
docker-app pull
docker-push: docker-build
docker-app -t $(tag) push
docker-app -l push
docker-run: docker-build
docker-app run
drop-database:
run-app python3 -m app drop-database
drop-app-database || true
get-configuration:
get-configuration app.ini
get-parameters:
run-app python3 -m app get-parameters
get-status:
get-app-status
install:
$(home)/bin/install-app
pycode: .update
$(home)/bin/run-app pycodestyle app tests
pylint: .update
$(home)/bin/run-app pylint app tests
pytest: .update
$(home)/bin/run-app pytest
pytest-all: .update
$(home)/bin/run-app pytest tests
realclean: clean clean-virtualenv
@/bin/rm -f .update
reinstall: uninstall install
restart:
$(home)/bin/restart-app
run: .update create-database
run-app flask run
run-debug: .update create-database
run-app flask run --port $$(($(APP_PORT) + 1))
scripts:
scripts/install-utility-scripts
start:
$(home)/bin/start-app
stop:
$(home)/bin/stop-app
stress: .env
clients/load-test
superclean: realclean uninstall-all
uninstall: stop
$(home)/bin/uninstall-app
uninstall-all: stop
$(home)/bin/uninstall-app -a
.PHONY: all clean clean-app-caches clean-virtualenv client client-debug
.PHONY: create-database docker-build docker-compose docker-pull docker-push
.PHONY: docker-run docker-tag drop-database get-confiuguration get-parameters
.PHONY: get-status install pycode pylint pytest pytest-all realclean restart
.PHONY: run run-debug scripts start stop superclean uninstall uninstall-all
.env: .env-template
scripts/configure-env $@ $<
.env-api: .env-template
scripts/configure-env $@ $<
.env-mysql: .env-template-mysql
scripts/configure-env $@ $<
.env-postgres: .env-template-postgres
scripts/configure-env $@ $<
.update: Pipfile
$(home)/bin/refresh-virtualenv
touch $@
scripts/chown-real-user $@